* @author William DURAND */ class ModelBuildCommand extends AbstractCommand { /** * @see Command */ protected function configure() { $this ->setDescription('Build the Propel Object Model classes based on XML schemas') ->addArgument('bundle', InputArgument::OPTIONAL, 'The bundle to generate model classes from') ->addOption('connection', null, InputOption::VALUE_OPTIONAL, 'Set this parameter to define a connection to use') ->setHelp(<<%command.name% command builds the Propel runtime model classes (ActiveRecord, Query, Peer, and TableMap classes) based on the XML schemas defined in all Bundles. php app/console %command.full_name% EOT ) ->setName('propel:model:build') ; } /** * @see Command * * @throws \InvalidArgumentException When the target directory does not exist */ protected function execute(InputInterface $input, OutputInterface $output) { if (true === $this->callPhing('om')) { foreach ($this->tempSchemas as $schemaFile => $schemaDetails) { $output->writeln(sprintf( '>> %20s Generated model classes from %s', $schemaDetails['bundle'], $schemaDetails['basename'] )); } } else { $this->writeTaskError($output, 'om'); } } }