* @author William DURAND */ class BuildModelCommand extends PhingCommand { /** * @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) { if ($input->getOption('verbose')) { $this->additionalPhingArgs[] = 'verbose'; } if (true === $this->callPhing('om')) { $this->writeSection($output, '[Propel] You are running the command: propel:build-model'); foreach ($this->tempSchemas as $schemaFile => $schemaDetails) { $output->writeln(sprintf( 'Built Model classes for bundle %s from %s.', $schemaDetails['bundle'], $schemaDetails['path'] )); } } else { $output->writeln('WARNING ! An error has occured.'); } } }