public function extract(AbstractDiffItem $item)
    {
        $connection = $this->getConnection();
        $descriptors = $this->getExtractionCollection()->getDescriptors();
        $action = $this->resolveItemAction($item);
        /** @var ExtractionDescriptorInterface $descriptor */
        foreach ($descriptors as $descriptor) {
            $table = $descriptor->getTable();
            if ($table === $item->getCategory() && $action === $descriptor->getTriggerTypeAlias()) {
                if ($action === ActionTypes::UPDATE
                    && !$this->isTrackedFieldModified($item, $descriptor)
                ) {
                    continue;
                }
                $insertList = $descriptor->getSqlInsertList();
                $idField = $insertList[JobTableFields::ID]['value'];

                $idFieldName = str_replace(['OLD.', 'NEW.'], '', $idField);
                $itemRow = $item->getItem();

                $statements = $descriptor->getRelations();

                if (isset($insertList[JobTableFields::TYPE]['value'])) {
                    $itemId = $itemRow[$idFieldName];

                    $storage = $this->getStorageFacility();
                    $storage->save(
                        $action,
                        $insertList[JobTableFields::TYPE]['value'],
                        $itemId,
                        $item->getTimestamp(),
                        $this->getShopIds()
                    );
                } elseif (empty($statements)) {
                    throw new \LogicException(
                        'Missing relations or no document type set in descriptor "'
                        . $descriptor->getName() . '"'
                    );
                }

                foreach ($statements as $statement) {
                    $selectQuery = $statement->getSelectQuery();
                    $sql = $this->inlineContext($selectQuery, $itemRow);
                    $executed = $connection->executeQuery($sql);
                    $this->saveResult($item, $executed);
                }
            }
        }
    }
public function extract(AbstractDiffItem $item)
    {
        $connection = $this->getConnection();
        $descriptors = $this->getExtractionCollection()->getDescriptors();
        $action = $this->resolveItemAction($item);
        /** @var ExtractionDescriptorInterface $descriptor */
        foreach ($descriptors as $descriptor) {
            $table = $descriptor->getTable();
            if ($table === $item->getCategory() && $action === $descriptor->getTriggerTypeAlias()) {
                if ($action === ActionTypes::UPDATE
                    && !$this->isTrackedFieldModified($item, $descriptor)
                ) {
                    continue;
                }
                $insertList = $descriptor->getSqlInsertList();
                $idField = $insertList[JobTableFields::ID]['value'];

                $idFieldName = str_replace(['OLD.', 'NEW.'], '', $idField);
                $itemRow = $item->getItem();

                $statements = $descriptor->getRelations();

                if (isset($insertList[JobTableFields::TYPE]['value'])) {
                    $itemId = $itemRow[$idFieldName];

                    $storage = $this->getStorageFacility();
                    $storage->save(
                        $action,
                        $insertList[JobTableFields::TYPE]['value'],
                        $itemId,
                        $item->getTimestamp(),
                        $this->getShopIds()
                    );
                } elseif (empty($statements)) {
                    throw new \LogicException(
                        'Missing relations or no document type set in descriptor "'
                        . $descriptor->getName() . '"'
                    );
                }

                foreach ($statements as $statement) {
                    $selectQuery = $statement->getSelectQuery();
                    $sql = $this->inlineContext($selectQuery, $itemRow);
                    $executed = $connection->executeQuery($sql);
                    $this->saveResult($item, $executed);
                }
            }
        }
    }
{@inheritdoc}

@throws \LogicException