Нет единой команды для этого.
Вы можете создать задачу, которая читает schema.yml, извлекает оттуда все имена моделей и вызывает doctrine: задача generate-module с каждым именем модели.
Вот пример такой задачи:
class BuildAllModulesTask extends sfBaseTask
{
protected function configure()
{
$this->addOptions(
array(
new sfCommandOption('application', null, sfCommandOption::PARAMETER_REQUIRED, 'The application name', 'backend'),
new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment', 'dev'),
new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'),
)
);
$this->namespace = 'ns';
$this->name = 'build-all-modules';
$this->aliases = array('bam');
$this->briefDescription = 'Builds a module for each model in schema.yml';
$this->detailedDescription = <<<EOF
The Task [Builds a module for each model in schema.yml|INFO]
Call it with:
[php symfony ns:build-all-modules|INFO]
EOF;
$this->addOptions(
array(
new sfCommandOption('app', null, sfCommandOption::PARAMETER_OPTIONAL, 'Application', 'backend')
)
);
}
/**
*
*
* @param array $arguments
* @param array $options
* @return void
*/
protected function execute($arguments = array(), $options = array())
{
$this->logSection('Step 1', 'Read all models from schema.yml');
$yaml = new sfYamlParser();
$models_array = $yaml->parse(file_get_contents(sfConfig::get('sf_config_dir') . '/doctrine/schema.yml'));
$this->logSection('Step 1', 'There are ' . sizeof($models_array) . ' models in the schema.yml');
$this->logSection('STEP 2', 'Go through all models from schema.yml and build an admin module in the "' . $options['app'] . '"');
$sfDoctrineGenerateAdminTask = new sfDoctrineGenerateAdminTask($this->dispatcher, $this->formatter);
$generate_options = array(
'theme' => 'admin', // You can use here some other theme like jroller from ThemeJRoller plugin
'env' => 'prod' // Here you can change to dev to see verbose output
);
foreach ($models_array as $model_name => $model_data) {
if ($model_name == 'options') continue;
$this->logSection('STEP 2', 'Processing "' . $model_name . '"');
$args = array(
'application' => $options['app'],
'route_or_model' => $model_name,
);
$sfDoctrineGenerateAdminTask->run($args, $generate_options);
}
}
}