我正在运行一个使用codeigniter和doctrine2的应用程序堆栈。我成功地运行命令行工具来生成我的模型,代理和数据库,直到几天前。 Y'day我对我的XML映射做了一些补充,现在如果我运行
php doctrine-cli.php orm:create
它给了我以下错误并退出:
[Doctrine\ORM\ORMException] This behaviour is (currently) not supported by Doctrine 2
然而,我做了
php doctrine-cli.php orm:validate-schema --verbose
这给了我以下信息:
[Mapping] OK - The mapping files are correct.
[Doctrine\ORM\ORMException]
This behaviour is (currently) not supported by Doctrine 2
Exception trace:
() at C:\wamp\www\frsale\application\libraries\Doctrine\ORM\ORMException.php:12
8
Doctrine\ORM\ORMException::notSupported() at C:\wamp\www\frsale\application\lib
raries\Doctrine\ORM\Tools\SchemaTool.php:439
Doctrine\ORM\Tools\SchemaTool->_gatherRelationsSql() at C:\wamp\www\frsale\appl
ication\libraries\Doctrine\ORM\Tools\SchemaTool.php:213
Doctrine\ORM\Tools\SchemaTool->getSchemaFromMetadata() at C:\wamp\www\frsale\ap
plication\libraries\Doctrine\ORM\Tools\SchemaTool.php:711
Doctrine\ORM\Tools\SchemaTool->getUpdateSchemaSql() at C:\wamp\www\frsale\appli
cation\libraries\Doctrine\ORM\Tools\SchemaValidator.php:287
Doctrine\ORM\Tools\SchemaValidator->schemaInSyncWithMetadata() at C:\wamp\www\f
rsale\application\libraries\Doctrine\ORM\Tools\Console\Command\ValidateSchemaCom
mand.php:77
Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand->execute() at C:\wamp\
www\frsale\application\libraries\Doctrine\Symfony\Component\Console\Command\Comm
and.php:239
Symfony\Component\Console\Command\Command->run() at C:\wamp\www\frsale\applicat
ion\libraries\Doctrine\Symfony\Component\Console\Application.php:193
Symfony\Component\Console\Application->doRun() at C:\wamp\www\frsale\applicatio
n\libraries\Doctrine\Symfony\Component\Console\Application.php:106
Symfony\Component\Console\Application->run() at C:\wamp\www\frsale\application\
doctrine-cli.php:42
orm:validate-schema
有人可以指出我可能会遇到什么问题。
注意:我的实体和代理生成没有任何问题
编辑:关闭这个,因为我发现了问题,它只是在映射中定义的关系产生了问题。
答案 0 :(得分:7)
当实体映射出现问题时,通常会发生此错误。例如:
/**
* @OneToMany(targetEntity="Task", mappedBy="")
*/
private $task
此处未指定mappedBy属性,导致此错误。