Command/GenerateScopeCommand.php
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $container         = $this->getContainer();
        $modelClass        = $this->validateClass($input->getArgument('model'));
        $doctrine          = $this->getContainer()->get('doctrine');
        $skeletonDirectory = __DIR__ . '/../Resources/skeleton';

        try {
            $scopeGenerator = new ScopeGenerator(
                $container->get('kernel'),
                $doctrine,
                $container->getParameter('glavweb_data_schema.scope_dir'),
                $skeletonDirectory
            );

            $scopeGenerator->generate($modelClass);
            $output->writeln(sprintf(
                '%sThe scope file "<info>%s</info>" has been %s.',
                PHP_EOL,
                realpath($scopeGenerator->getTemplateFile()),
                ($scopeGenerator->isFileTemplateUpdated() ? 'updated' : 'generated')
            ));

            if ($scopeGenerator->isFileGenerated()) {
                $output->writeln(sprintf(
                    '%sThe scope file "<info>%s</info>" has been generated.',
                    PHP_EOL,
                    realpath($scopeGenerator->getFile())
                ));
            }

        } catch (\Exception $e) {
            $this->writeError($output, $e->getMessage());
        }

        return 0;
    }
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $container         = $this->getContainer();
        $modelClass        = $this->validateClass($input->getArgument('model'));
        $doctrine          = $this->getContainer()->get('doctrine');
        $skeletonDirectory = __DIR__ . '/../Resources/skeleton';

        try {
            $scopeGenerator = new ScopeGenerator(
                $container->get('kernel'),
                $doctrine,
                $container->getParameter('glavweb_data_schema.scope_dir'),
                $skeletonDirectory
            );

            $scopeGenerator->generate($modelClass);
            $output->writeln(sprintf(
                '%sThe scope file "<info>%s</info>" has been %s.',
                PHP_EOL,
                realpath($scopeGenerator->getTemplateFile()),
                ($scopeGenerator->isFileTemplateUpdated() ? 'updated' : 'generated')
            ));

            if ($scopeGenerator->isFileGenerated()) {
                $output->writeln(sprintf(
                    '%sThe scope file "<info>%s</info>" has been generated.',
                    PHP_EOL,
                    realpath($scopeGenerator->getFile())
                ));
            }

        } catch (\Exception $e) {
            $this->writeError($output, $e->getMessage());
        }

        return 0;
    }
{@inheritDoc}