SnippetStep example

/** @var DumpIterator $dump */
        $dump = $this->container->get('dump');

        if (!$dump) {
            $this->IOHelper->writeln('skipped...');

            return 1;
        }

        /** @var PDO $conn */
        $conn = $this->container->get('db');
        $snippetStep = new SnippetStep($conn$dump);

        $progress = $this->IOHelper->createProgressBar($dump->count());
        $progress->start();

        $offset = 0;
        do {
            $progress->setProgress($offset);
            $result = $snippetStep->run($offset);
            if ($result instanceof ErrorResult) {
                throw new Exception($result->getMessage(), 0, $result->getException());
            }
            
public function importSnippets()
    {
        $dump = $this->container->get('dump');
        if (!$dump) {
            $result = new FinishResult(0, 0);
            $this->toJson(200, $this->resultMapper->toExtJs($result));

            return;
        }

        $conn = $this->container->get('db');
        $snippetStep = new SnippetStep($conn$dump);

        $offset = $this->request->get('offset');
        $result = $snippetStep->run($offset);

        $this->toJson(200, $this->resultMapper->toExtJs($result));
    }

    public function applyMigrations()
    {
        /** @var Manager $migrationManger */
        $migrationManger = $this->container->get('migration.manager');
        
Home | Imprint | This part of the site doesn't use cookies.