public function execute()
 {
     Doctrine_Core::generateYamlFromModels($this->getArgument('yaml_schema_path'), $this->getArgument('models_path'));
     $this->notify('Generated YAML schema successfully from models');
 }
 /**
  * model2yaml
  *
  * This generates YAML schema files from MODELS
  * This generates TABLES from MODELS.
  *
  * @see Doctrine_Core::generateSqlFromYaml()
  */
 public function action_admin_models2yaml()
 {
     // load sfYAML (it's somehow not loaded by doctrine autoload)
     include ROOT_LIBRARIES . 'doctrine/Doctrine/Parser/sfYaml/SfYaml.php';
     #Doctrine_Core::dropDatabases();
     #Doctrine_Core::createDatabases();
     Doctrine_Core::generateYamlFromModels(DOCTRINE_YAML_SCHEMA_PATH . DIRECTORY_SEPARATOR . 'schema.yml', DOCTRINE_MODELS_PATH);
     #Doctrine_Core::createTablesFromModels( DOCTRINE_MODELS_PATH );
     $message = '<b>The YAML schema file has been successfully generated from MODELS.</b>';
     $message .= '<br /><br />Destination File: ' . DOCTRINE_YAML_SCHEMA_PATH . 'schema.yml';
     #$message .= '<br /><br />The DATABASE TABLES have been successfully generated from MODELS.';
     $this->setFlashmessage('success', $message);
     $this->redirectToReferer();
 }
Exemple #3
0
 private function generateYamlFromModels()
 {
     $file_path = $this->getOptionsValue('yaml-schema-path');
     $file_path .= '/' . $this->getArgumentsValue('output-name');
     \Doctrine_Core::generateYamlFromModels($file_path, $this->getOptionsValue('models-path'));
 }
/**
 * Generate YAML Schema file from Models
 * @param string $name
 */
function doctrine_create_yaml($name)
{
    Doctrine_Core::generateYamlFromModels(SCHEMA_DIRECTORY . $name . '.yml', MODELS_DIRECTORY);
}
 public function generateYamlFromModels()
 {
     $doctrine = $this->_getDoctrineRegistry();
     $this->_loadDoctrineModels();
     $yamlDir = $this->_getYamlDirectoryPath();
     Doctrine_Core::generateYamlFromModels($yamlDir, null);
     $this->_print('Successfully generated yaml schema files from model.', array('color' => 'green'));
     $this->_print('Destination Directory: ' . $yamlDir);
 }
Exemple #6
0
 public function generateSchema()
 {
     Doctrine_Core::generateYamlFromModels(MODELS . '/schema/generated.yml', MODELS);
     FlashComponent::set('info', 'Generate Schema terminé.');
     $this->redirect(array('action' => 'index'));
 }