我正在运行一个应用程序堆栈,该堆栈使用 codeigniter 和教义 2。直到几天前,我一直在成功运行命令行工具来生成我的模型、代理和数据库。那天我对我的 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
谁能指出这里可能是什么问题。
注意:我的实体和代理生成没有任何问题
编辑:当我发现问题时关闭它,它只不过是映射中定义的关系,这会造成问题。
最佳答案
当实体映射出现问题时,通常会发生此错误。例如:
/**
* @OneToMany(targetEntity="Task", mappedBy="")
*/
private $task
这里没有指定上面的mappedBy属性,导致这个错误。
关于php - 教义\ORM\ORMException : This behaviour is (currently) not supported by Doctrine 2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13708761/