resourceSequenceMeta = $resourceSequenceMeta; $this->sequenceFactory = $sequenceFactory; } /** * Returns sequence for given entityType and store * * @param string $entityType * @param int $storeId * * @return \Magento\Framework\DB\Sequence\SequenceInterface * @throws \Magento\Framework\Exception\LocalizedException */ public function getSequence($entityType, $storeId) { return $this->sequenceFactory->create( [ 'meta' => $this->resourceSequenceMeta->loadByEntityTypeAndStore( $entityType, $storeId ) ] ); } }