Author: Fabien Potencier (fabien@symfony.com)
Inheritance: extends Sensio\Bundle\GeneratorBundle\Command\GenerateDoctrineCommand
 /**
  * @see Command
  */
 protected function configure()
 {
     parent::configure();
     $this->setName('bacon:generate:crud');
     $this->setDescription('Gerador personalizado pela A2C');
     $this->setDefinition(array(new InputArgument('entity', InputArgument::OPTIONAL, 'The entity class name to initialize (shortcut notation)'), new InputOption('entity', '', InputOption::VALUE_REQUIRED, 'The entity class name to initialize (shortcut notation)'), new InputOption('route-prefix', '', InputOption::VALUE_REQUIRED, 'The route prefix'), new InputOption('with-write', '', InputOption::VALUE_NONE, 'Whether or not to generate create, new and delete actions'), new InputOption('format', '', InputOption::VALUE_REQUIRED, 'The format used for configuration files (php, xml, yml, or annotation)', 'annotation'), new InputOption('overwrite', '', InputOption::VALUE_NONE, 'Overwrite any existing controller or form class when generating the CRUD contents'), new InputOption('controller-folder', '', InputArgument::OPTIONAL, 'The controller folder name')));
 }
 protected function getGenerator(BundleInterface $bundle = null)
 {
     $generator = new DevelopatheCrudGenerator($this->getContainer()->get('filesystem'));
     $generator->setSkeletonDirs(__DIR__ . '/../Resources/skeleton');
     $this->setGenerator($generator);
     return parent::getGenerator($bundle);
 }
 protected function interact(InputInterface $input, OutputInterface $output)
 {
     if (method_exists($this, 'getDialogHelper')) {
         $dialog = $this->getDialogHelper();
     } else {
         $dialog = $this->getQuestionHelper();
     }
     $dialog->writeSection($output, 'JordiLlonchCrudGeneratorBundle');
     parent::interact($input, $output);
 }
 /**
  * configure the command.
  *
  * @return void
  * @access protected
  * @author Etienne de Longeaux <*****@*****.**>
  */
 protected function getGenerator($bundle = null)
 {
     //-----we initialize the logger-----
     $this->_logger = $this->getContainer()->get('sfynx.tool.log_manager');
     $this->_logger->setPath($this->getContainer()->getParameter("kernel.logs_dir"));
     $this->_logger->setInit('log_corebundle_crud', date("YmdH"));
     $this->_logger->setInfo(date("Y-m-d H:i:s") . " [LOG CRUD] Begin launch  :");
     $generator_crud = new DoctrineCrudGenerator($this->getContainer()->get('filesystem'), __DIR__ . '/../Resources/views/skeleton/crud');
     $this->setGenerator($generator_crud);
     $generator_form = new DoctrineFormGenerator($this->getContainer()->get('filesystem'), __DIR__ . '/../Resources/views/skeleton/form');
     $this->setFormGenerator($generator_form);
     //-----we close the logger-----
     $this->_logger->setInfo(date("Y-m-d H:i:s") . " [END] End launch");
     $this->_logger->save();
     return parent::getGenerator();
 }
 /**
  * @param BundleInterface $bundle
  * @return array
  */
 protected function getSkeletonDirs(BundleInterface $bundle = null)
 {
     $reflClass = new \ReflectionClass(get_class($this));
     $skeletonDirs = parent::getSkeletonDirs($bundle);
     $skeletonDirs[] = dirname($reflClass->getFileName()) . '/../Resources/skeleton';
     $skeletonDirs[] = dirname($reflClass->getFileName()) . '/../Resources';
     return $skeletonDirs;
 }
 protected function getSkeletonDirs(BundleInterface $bundle = null)
 {
     $parentDirs = parent::getSkeletonDirs($bundle);
     $dirs = array_merge(array(__DIR__ . '/../Resources/skeleton'), $parentDirs);
     return $dirs;
 }
 /**
  * @see Command
  */
 protected function configure()
 {
     parent::configure();
     $this->setAliases(array('oliorga:generate:crud'));
 }
 /**
  * add this bundle skeleton dirs to the beginning of the parent skeletonDirs array
  *
  * @param BundleInterface $bundle
  *
  * @return array
  */
 protected function getSkeletonDirs(BundleInterface $bundle = null)
 {
     $baseSkeletonDirs = parent::getSkeletonDirs($bundle);
     $skeletonDirs = array();
     if (isset($bundle) && is_dir($dir = $bundle->getPath() . '/Resources/PUGXGeneratorBundle/skeleton')) {
         $skeletonDirs[] = $dir;
     }
     if (is_dir($dir = $this->getContainer()->get('kernel')->getRootdir() . '/Resources/PUGXGeneratorBundle/skeleton')) {
         $skeletonDirs[] = $dir;
     }
     $bundlesDirectories = $this->getContainer()->get('kernel')->locateResource('@PUGXGeneratorBundle/Resources/skeleton', null, false);
     $skeletonDirs = array_merge($skeletonDirs, $bundlesDirectories);
     $skeletonDirs[] = __DIR__ . '/../Resources';
     return array_merge($skeletonDirs, $baseSkeletonDirs);
 }
 protected function getGenerator()
 {
     $generator = new DoctrineCrudGenerator($this->getContainer()->get('filesystem'), __DIR__ . '/../Resources/skeleton/crud');
     $this->setGenerator($generator);
     return parent::getGenerator();
 }
 protected function interact(InputInterface $input, OutputInterface $output)
 {
     $dialog = $this->getQuestionHelper();
     $dialog->writeSection($output, 'ItscaroCrudGeneratorBundle');
     parent::interact($input, $output);
 }
 protected function interact(InputInterface $input, OutputInterface $output)
 {
     $dialog = $this->getDialogHelper();
     $dialog->writeSection($output, 'JordiLlonchCrudGeneratorBundle');
     parent::interact($input, $output);
 }
 /**
  * @see Command
  */
 protected function configure()
 {
     parent::configure();
     $this->setName('rmc:generate:crud');
     $this->setDescription('CRUD generator that supports entities outside a bundle for rmc');
 }
示例#13
0
 protected function configure()
 {
     parent::configure();
 }
 protected function configure()
 {
     parent::configure();
     $this->setName('mwsimple:generate:admincrud');
     $this->setDescription('Generates a ADMINCRUD and paginator based on a Doctrine entity');
 }