Doctrine SQL/table generation failing

Duditas

New Member
I am trying to make Doctrine generate SQL from a set of models that I created earlier with a YAML schema. Using the code below which comes from the manual the output should be a set of queries.\[code\]<?php// test.phprequire_once('bootstrap.php');try { $models = Doctrine_Core::generateSqlFromModels('models/generated'); echo '<pre>'; var_dump($models); echo '</pre>';}catch(Exception $e){ echo $e->getMessage();}\[/code\]However, the result of this code is:\[code\]NULL\[/code\]while it should return a string with the SQL queries, as said before. I've also tried the following:\[code\]<?php// test.phprequire_once('bootstrap.php');try { $result = Doctrine_Core::createTablesFromModels('models/generated'); echo '<pre>'; var_dump($result); echo '</pre>';}catch(Exception $e){ echo $e->getMessage();}\[/code\]but that also returns:\[code\]NULL\[/code\]I was not able to find the solution in the manual, the API reference or in the Doctrine core files. I hope someone here knows.Thanks in advance.Update: It can not be because of this (old?) bug, because I have no table name that starts with A or B.Update: My bootstrap.php looks like this:\[code\]/** * Bootstrap Doctrine.php, register autoloader specify * configuration attributes and load models. */require_once(dirname(__FILE__) . '/lib/vendor/doctrine/Doctrine.php');spl_autoload_register(array('Doctrine', 'autoload'));$manager = Doctrine_Manager::getInstance();$conn = Doctrine_Manager::connection('pgsql://user:pass@localhost/dbname', 'doctrine');$manager->setAttribute(Doctrine_Core::ATTR_VALIDATE, Doctrine_Core::VALIDATE_ALL);$manager->setAttribute(Doctrine_Core::ATTR_EXPORT, Doctrine_Core::EXPORT_ALL);$manager->setAttribute(Doctrine_Core::ATTR_MODEL_LOADING, Doctrine_Core::MODEL_LOADING_CONSERVATIVE);\[/code\]Update: I've changed the line:\[code\]$manager->setAttribute(Doctrine_Core::ATTR_MODEL_LOADING, Doctrine_Core::MODEL_LOADING_CONSERVATIVE);\[/code\]to:\[code\]$manager->setAttribute(Doctrine_Core::ATTR_MODEL_LOADING, Doctrine_Core::MODEL_LOADING_AGGRESSIVE);\[/code\]but the output of\[code\]print_r(Doctrine_Core::filterInvalidModels(Doctrine_Core::loadModels('models/generated'))) \[/code\]is still an empty array.
 
Back
Top