Changeset 8150
- Timestamp:
- 03/29/08 09:25:15 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.1/lib/plugins/sfPropelPlugin/lib/propel/sfPropelData.class.php
r8112 r8150 314 314 * Returns data from one or more tables. 315 315 * 316 * @param string directory or file to dump to317 316 * @param mixed name or names of tables to dump (or all to dump all tables) 318 317 * @param string connection name branches/1.1/lib/plugins/sfPropelPlugin/lib/task/sfPropelDataDumpTask.class.php
r7962 r8150 34 34 new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environement', 'dev'), 35 35 new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'propel'), 36 new sfCommandOption('classes', null, sfCommandOption::PARAMETER_REQUIRED, 'The class names to dump (separated by a colon)', null), 36 37 )); 37 38 … … 61 62 62 63 [./symfony propel:data-load --connection="name" frontend|INFO] 64 65 If you only want to dump some classes, use the [classes|COMMENT] option: 66 67 [./symfony propel:data-load --classes="Article,Category" frontend|INFO] 63 68 EOF; 64 69 } … … 85 90 $data = new sfPropelData(); 86 91 92 $classes = is_null($options['classes']) ? 'all' : explode(',', $options['classes']); 93 87 94 if (!is_null($filename)) 88 95 { 89 $data->dumpData($filename, 'all', $options['connection']);96 $data->dumpData($filename, $classes, $options['connection']); 90 97 } 91 98 else 92 99 { 93 fwrite(STDOUT, sfYaml::dump($data->getData( 'all', $options['connection']), 3));100 fwrite(STDOUT, sfYaml::dump($data->getData($classes, $options['connection']), 3)); 94 101 } 95 102 }

