/**
 * Populate database with YAML fixtures
 * @param string $name
 */
function doctrine_extract_database_data($name = NULL, $individual = FALSE)
{
    if ($individual === TRUE) {
        $location = FIXTURES_DIRECTORY;
    } else {
        $location = FIXTURES_DIRECTORY . $name . '.yml';
    }
    Doctrine_Core::dumpData($location, $individual);
}
Exemple #2
0
 public function execute()
 {
     $models = Doctrine_Core::loadModels($this->getArgument('models_path'));
     if (empty($models)) {
         throw new Doctrine_Task_Exception('No models were loaded');
     }
     $path = $this->getArgument('data_fixtures_path');
     if (is_array($path) && count($path) > 0) {
         $path = $path[0];
     }
     if (!empty($path)) {
         Doctrine_Core::dumpData($path);
         $this->notify(sprintf('Dumped data successfully to: %s', $path));
     } else {
         throw new Doctrine_Task_Exception('Unable to find data fixtures path.');
     }
 }
 public function dumpData($individualFiles = false)
 {
     $this->_loadDoctrineModels();
     $fixtureDir = $this->_getDataFixtureDirectoryPath();
     Doctrine_Core::dumpData($fixtureDir, $individualFiles);
     $this->_print('Successfully dumped current database contents into fixture directory.', array('color' => 'green'));
     $this->_print('Destination Directory: ' . $fixtureDir);
 }