* @author William DURAND */ class BuildModelCommand extends AbstractPropelCommand { /** * @see Command */ protected function configure() { $this ->setDescription('Build the Propel Object Model classes based on XML schemas') ->setHelp(<<propel:build-model 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 propel:build-model EOT ) ->setName('propel:build-model') ; } /** * @see Command * * @throws \InvalidArgumentException When the target directory does not exist */ protected function execute(InputInterface $input, OutputInterface $output) { $this->writeSection($output, '[Propel] You are running the command: propel:build-model'); if ($input->getOption('verbose')) { $this->additionalPhingArgs[] = 'verbose'; } 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'); } } }