Execute the console command.

@param PackageManagerInterface $manager

@return mixed
541063
public function fire(PackageManagerInterface $manager)
    {
        $packages = [];

        $i = 0;

        /** @var PackageInterface[] $packagesList */
        $packagesList = $manager->all();

        foreach ($packagesList as $name => $package) {
            /** @var AssetElementInterface[] $files */
            $files = $package->all();

            foreach ($files as $file) {
                if (isset($packages[$name])) {
                    $packages[$i]['id'] = '';
                    $packages[$i]['files'] = $file->getSrc();
                    $packages[$i]['deps'] = $file->getDependency();

                    $i++;
                } else {
                    $packages[$name]['id'] = $name;
                    $packages[$name]['files'] = $file->getSrc();
                    $packages[$name]['deps'] = $file->getDependency();
                }
            }

            $packages[$i] = new TableSeparator();
            $i++;
        }

        foreach ($packages as $i => $data) {
            foreach ($data as $key => $rows) {
                if (is_array($rows)) {
                    $packages[$i][$key] = implode(', ', $rows);
                }
            }
        }

        $this->table($this->headers, $packages);
    }
629960
public function init(ModuleManagerInterface $manager)
    {
        $events = $manager->getEventManager();
        $events->attach(ModuleEvent::EVENT_MERGE_CONFIG, array($this, 'addPageTypes'));
        $events->attach(ModuleEvent::EVENT_MERGE_CONFIG, array($this, 'addBlocks'));
    }
1046447
public function addToManager(Manager $manager)
    {
        $this->extend('onBeforeAddToManager', $manager);
        $scaffold = $this->scaffold($manager);
        if (!$manager->hasType($this->getTypeName())) {
            $manager->addType($scaffold, $this->getTypeName());
        }

        foreach ($this->operations as $op) {
            $op->addToManager($manager);
        }

        foreach ($this->nestedQueries as $scaffold) {
            $scaffold->addToManager($manager);
        }

        $this->extend('onAfterAddToManager', $manager);
    }
991972
public function handle(
        ConfigurationProvider $provider,
        ManagerRegistry $registry,
        SqlBuilder $builder,
        MigrationFileGenerator $generator
    ) {
        $configuration = $provider->getForConnection($this->option('connection'));
        $em            = $registry->getManager($this->option('connection'));
        $connection    = $configuration->getConnection();

        // Overrule the filter
        if ($filterExpr = $this->option('filter-expression')) {
            $connection->getConfiguration()->setFilterSchemaAssetsExpression($filterExpr);
        }

        $fromSchema = $connection->getSchemaManager()->createSchema();
        $toSchema   = $this->getSchemaProvider($em)->createSchema();

        // Drop tables which don't suffice to the filter regex
        if ($filterExpr = $connection->getConfiguration()->getFilterSchemaAssetsExpression()) {
            foreach ($toSchema->getTables() as $table) {
                $tableName = $table->getName();
                if (!preg_match($filterExpr, $this->resolveTableName($tableName))) {
                    $toSchema->dropTable($tableName);
                }
            }
        }

        $up   = $builder->up($configuration, $fromSchema, $toSchema);
        $down = $builder->down($configuration, $fromSchema, $toSchema);

        if (!$up && !$down) {
            return $this->error('No changes detected in your mapping information.');
        }

        $path = $generator->generate(
            $configuration,
            false,
            false,
            $up,
            $down
        );

        $this->line(sprintf('Generated new migration class to "<info>%s</info>" from schema differences.', $path));
    }
12794
public function load(ObjectManager $manager)
    {
        /**
         * @var ObjectDirector $manufacturerDirector
         */
        $manufacturerDirector = $this->getDirector('manufacturer');

        $manufacturer = $manufacturerDirector
            ->create()
            ->setName('manufacturer')
            ->setSlug('manufacturer')
            ->setDescription('manufacturer description');

        $manufacturerDirector->save($manufacturer);
        $this->addReference('manufacturer', $manufacturer);
    }
496950
public function load(ObjectManager $manager)
    {
        $this->manager = $manager;
        $options = $this->getOptions();

        $parser = new Parser();

        $data = [];
        foreach ($this->getFixtures() as $fixture) {
            $data[] = $parser->parse(file_get_contents($fixture));
        }

        $fixtures = $this->initFixtures($data);
        $builder = $this->container->get('kunstmaan_fixtures.builder.builder');
        $locale = isset($options['locale']) ? $options['locale'] : 'en_US';

        foreach ($this->getProviders() as $provider) {
            $builder->addProvider($provider);
        }

        /*
         * because of faker's magic calls we'll want to add this as last provider
         */
        $builder->addProvider(Factory::create($locale));
        $builder->setFixtures($fixtures);
        $builder->buildFixtures($manager);
    }
309374
public function manage()
    {
        if (!($this->processManagerDto instanceof ProcessManagerDto)) {
            throw new ProcessManagerException("ProcessManagerDto wasn't set.");
        }

        $this->executionDto = new ExecutionDto();
        $this->reactControlDto = $this->processManagerDto;
        $this->initStartMethods();
        $this->context = new Context($this->loop);

        $this->dtoContainer = new DtoContainer();
        $this->tasks = $this->processManagerDto->getTasksNumber();
        $this->commandsManager = new CommandsManager();
        $this->logger->info("PM start work." . $this->loggerPostfix);

        $this->initWorkersPublisher();
        $this->declareLmRequester();

        $this->initLoadManager();
        $this->initLoadManagingControl();

        $this->loop->run();

        return null;
    }
319135
public function handle(ManagerRegistry $registry)
    {
        $names = $this->option('em') ? [$this->option('em')] : $registry->getManagerNames();

        foreach ($names as $name) {
            $em = $registry->getManager($name);

            $this->comment('');
            $this->message('Generating getter and setter for <info>' . $name . '</info> entity manager...', 'blue');

            $cmf = new DisconnectedClassMetadataFactory();
            $cmf->setEntityManager($em);
            $metadatas = $cmf->getAllMetadata();
            $metadatas = MetadataFilter::filter($metadatas, $this->option('filter'));

            $destPath = base_path($this->argument('dest-path') ?:'app/Entities');

            if (!is_dir($destPath)) {
                mkdir($destPath, 0777, true);
            }

            $destPath = realpath($destPath);

            if (!file_exists($destPath)) {
                throw new \InvalidArgumentException(
                    sprintf("Proxies destination directory ' < info>%s </info > ' does not exist.",
                        $em->getConfiguration()->getProxyDir())
                );
            }

            if (count($metadatas)) {

                // Create EntityGenerator
                $entityGenerator = new EntityGenerator();

                $entityGenerator->setGenerateAnnotations($this->option('generate-annotations'));
                $entityGenerator->setGenerateStubMethods($this->option('generate-methods'));
                $entityGenerator->setRegenerateEntityIfExists($this->option('regenerate-entities'));
                $entityGenerator->setUpdateEntityIfExists($this->option('update-entities'));
                $entityGenerator->setNumSpaces($this->option('num-spaces'));
                $entityGenerator->setBackupExisting(!$this->option('no-backup'));

                if (($extend = $this->option('extend')) !== null) {
                    $entityGenerator->setClassToExtend($extend);
                }

                foreach ($metadatas as $metadata) {
                    $this->comment(
                        sprintf('Processing entity "<info>%s</info>"', $metadata->name)
                    );
                }

                // Generating Entities
                $entityGenerator->generate($metadatas, $destPath);

                // Outputting information message
                $this->comment(PHP_EOL . sprintf('Entity classes generated to "<info>%s</INFO>"', $destPath));
            }
        }
    }
81849
public function handle()
    {
        $url = $this->argument('url');

        try {
            list($vendorFolderName, $packageFolderName) = $this->getVendorAndFolderName($url);
        } catch (Exception $e) {
            $this->error($e->getMessage());

            return -1;
        }

        $vendor = $this->getVendor() ?: Str::title($vendorFolderName);
        $package = $this->getPackage() ?: Str::studly($packageFolderName);

        $relPackagePath = "packages/$vendorFolderName/$packageFolderName";
        $packagePath = base_path($relPackagePath);

        try {
            $this->cloneRepo($url, $packagePath, $this->option('branch'));
            $this->registerPackage($vendor, $package, $relPackagePath);
            $this->composerUpdatePackage($vendorFolderName, $packageFolderName);
            $this->composerDumpAutoload();

            $this->info('Finished.');
        } catch (Exception $e) {
            $this->error($e->getMessage());

            return -1;
        }

        return 0;
    }
516542
public function addManager($manager)
    {
        if (is_array($manager)) {
            foreach ($manager as $item) {
                $this->managerList->add($item);
            }

            return $this;
        }

        $this->managerList->add($manager);

        return $this;
    }
666071
public function load(ObjectManager $manager)
    {
        $translator = $this->container->get('translator');
        $infoName = $translator->trans('informations', array(), 'platform');

        $desktopHomeTab = new HomeTab();
        $desktopHomeTab->setType('admin_desktop');
        $desktopHomeTab->setName($infoName);
        $manager->persist($desktopHomeTab);

        $desktopHomeTabConfig = new HomeTabConfig();
        $desktopHomeTabConfig->setHomeTab($desktopHomeTab);
        $desktopHomeTabConfig->setType('admin_desktop');
        $desktopHomeTabConfig->setVisible(true);
        $desktopHomeTabConfig->setLocked(false);
        $desktopHomeTabConfig->setTabOrder(1);
        $manager->persist($desktopHomeTabConfig);

        $workspaceHomeTab = new HomeTab();
        $workspaceHomeTab->setType('admin_workspace');
        $workspaceHomeTab->setName($infoName);
        $manager->persist($workspaceHomeTab);

        $workspaceHomeTabConfig = new HomeTabConfig();
        $workspaceHomeTabConfig->setHomeTab($workspaceHomeTab);
        $workspaceHomeTabConfig->setType('admin_workspace');
        $workspaceHomeTabConfig->setVisible(true);
        $workspaceHomeTabConfig->setLocked(false);
        $workspaceHomeTabConfig->setTabOrder(1);
        $manager->persist($workspaceHomeTabConfig);
    }
541754
public function fire(ThemeManager $manager)
    {
        try {
            $installed = $manager->findAndInstallNewTemplates();

            if (!count($installed)) {
                return $this->info('No templates to install');
            }

            foreach ($installed as $i) {
                list($theme, $template) = $i;

                $this->info("Installed $template in theme $theme");
            }
        } catch (PDOException $e) {
            $this->info('Unable to install templates: '.$e->getMessage());
        }
    }
1128509
public function init(ModuleManagerInterface $manager)
    {
        if (!$manager instanceof ModuleManager) {
            $errMsg =sprintf('Module manager not implement %s', ModuleManager::class);
            throw new Exception\InvalidArgumentException($errMsg);
        }

        
        /** @var ServiceLocatorInterface $sm */
        $sm = $manager->getEvent()->getParam('ServiceManager');

        if (!$sm instanceof ServiceLocatorInterface) {
            $errMsg = sprintf('Service locator not implement %s', ServiceLocatorInterface::class);
            throw new Exception\InvalidArgumentException($errMsg);
        }
        /** @var ServiceListenerInterface $serviceListener */
        $serviceListener = $sm->get('ServiceListener');
        if (!$serviceListener instanceof ServiceListenerInterface) {
            $errMsg = sprintf('ServiceListener not implement %s', ServiceListenerInterface::class);
            throw new Exception\InvalidArgumentException($errMsg);
        }


        $serviceListener->addServiceManager(
            EntryNameResolverManagerInterface::class,
            EntryNameResolverManager::CONFIG_KEY,
            EntryNameResolverProviderInterface::class,
            'getEntryNameResolverConfig'
        );

    }
1233531
public function load(ObjectManager $manager)
    {
        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('jon-seller'));
        $sellerHubRef->setHub($this->getReference('sam-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.5);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('jon-seller'));
        $sellerHubRef->setHub($this->getReference('nick-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.6);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('jon-seller'));
        $sellerHubRef->setHub($this->getReference('ramon-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.55);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();




        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('stephen-seller'));
        $sellerHubRef->setHub($this->getReference('sam-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.5);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('stephen-seller'));
        $sellerHubRef->setHub($this->getReference('nick-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.6);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('stephen-seller'));
        $sellerHubRef->setHub($this->getReference('ramon-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.55);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();




        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('jo-seller'));
        $sellerHubRef->setHub($this->getReference('sam-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.5);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('jo-seller'));
        $sellerHubRef->setHub($this->getReference('nick-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.6);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('jo-seller'));
        $sellerHubRef->setHub($this->getReference('ramon-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.55);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();




        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('sterling-seller'));
        $sellerHubRef->setHub($this->getReference('sam-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.5);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('sterling-seller'));
        $sellerHubRef->setHub($this->getReference('nick-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.6);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('sterling-seller'));
        $sellerHubRef->setHub($this->getReference('nick-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.6);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('11:00');
        $windowMaker->setEndTime('13:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('sterling-seller'));
        $sellerHubRef->setHub($this->getReference('ramon-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.55);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();




        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('tom-seller'));
        $sellerHubRef->setHub($this->getReference('sam-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.5);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('tom-seller'));
        $sellerHubRef->setHub($this->getReference('nick-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.6);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();


        $sellerHubRef = new SellerHubRef();
        $sellerHubRef->setSeller($this->getReference('tom-seller'));
        $sellerHubRef->setHub($this->getReference('ramon-hub'));
        $sellerHubRef->setIsDefault(true);
        $sellerHubRef->setFixedFee(0.55);
        $sellerHubRef->setVariableFee(4);

        $windowMaker = new SellerWindowMaker();
        $windowMaker->setDeliveryType(HubWindow::DELIVERY_TYPE_PICKUP);
        $windowMaker->setDayOfWeekNumber(6);
        $windowMaker->setStartTime('09:00');
        $windowMaker->setEndTime('11:00');

        $sellerHubRef->addWindowMaker($windowMaker);

        $manager->persist($sellerHubRef);
        $manager->flush();
    }
156029
public function handle(ManagerRegistry $registry)
    {
        $names = $this->option('em') ? [$this->option('em')] : $registry->getManagerNames();

        foreach ($names as $name) {
            $em = $registry->getManager($name);

            if ($this->option('from-database') === true) {
                $databaseDriver = new DatabaseDriver(
                    $em->getConnection()->getSchemaManager()
                );

                $em->getConfiguration()->setMetadataDriverImpl(
                    $databaseDriver
                );

                if (($namespace = $this->option('namespace')) !== null) {
                    $databaseDriver->setNamespace($namespace);
                }
            }

            $cmf = new DisconnectedClassMetadataFactory();
            $cmf->setEntityManager($em);
            $metadata = $cmf->getAllMetadata();
            $metadata = MetadataFilter::filter($metadata, $this->option('filter'));

            // Process destination directory
            if (!is_dir($destPath = $this->argument('dest-path'))) {
                mkdir($destPath, 0775, true);
            }
            $destPath = realpath($destPath);

            if (!file_exists($destPath)) {
                throw new \InvalidArgumentException(
                    sprintf("Mapping destination directory '<info>%s</info>' does not exist.",
                        $this->argument('dest-path'))
                );
            }

            if (!is_writable($destPath)) {
                throw new \InvalidArgumentException(
                    sprintf("Mapping destination directory '<info>%s</info>' does not have write permissions.",
                        $destPath)
                );
            }

            $toType = strtolower($this->argument('to-type'));

            $exporter = $this->getExporter($toType, $destPath);
            $exporter->setOverwriteExistingFiles($this->option('force'));

            if ($toType == 'annotation') {
                $entityGenerator = new EntityGenerator();
                $exporter->setEntityGenerator($entityGenerator);

                $entityGenerator->setNumSpaces($this->option('num-spaces'));

                if (($extend = $this->option('extend')) !== null) {
                    $entityGenerator->setClassToExtend($extend);
                }
            }

            if (count($metadata)) {
                foreach ($metadata as $class) {
                    $this->info(sprintf('Processing entity "<info>%s</info>"', $class->name));
                }

                $exporter->setMetadata($metadata);
                $exporter->export();

                $this->info(PHP_EOL . sprintf(
                        'Exporting "<info>%s</info>" mapping information to "<info>%s</info>"', $toType, $destPath
                    ));
            } else {
                $this->info('No Metadata Classes to process.');
            }
        }
    }
941481
public function destroy(Manager $manager)
    {
        $manager->delete();

        return intend([
            'url' => route('adminarea.managers.index'),
            'with' => ['warning' => trans('cortex/foundation::messages.resource_deleted', ['resource' => trans('cortex/auth::common.manager'), 'identifier' => $manager->username])],
        ]);
    }
941355
public function handle(BlueprintManager $manager) {
        $blueprints = $manager->all();

        if(empty($blueprints)) {
            $this->error("Your application doesn't have any blueprints.");

            return;
        }

        $generalTable = new Table($this->output);
        $generalTable->setHeaders($this->headers);
        $generalTable->setRows($this->getTable($blueprints));
        $generalTable->render();
    }