开发者

Symfony2, Doctrine2 and PostgreSQL: error "Undefined variable: className"

I try to configur开发者_如何学运维e entities for existing table in PostgreSQL database. Sequences in this database have names other than default doctrine names, so i have to account that in entity.

Webclient\db\LoginBundle\Entity\WebclientUsers:
type: entity
table: webclient.t_webclientusers
fields:
  id:
    type: integer
    generator:
      strategy: AUTO
    sequenceGenerator:
      sequenceName: webclient.s_webclientusers_id
  email:
    type: text
lifecycleCallbacks: {  }

I tried also other strategy configurations, but i still having error:

Notice: Undefined variable: className in ****\Symfony\vendor\doctrine\lib\Doctrine\ORM\Mapping\ClassMetadataFactory.php line 343

What can I do with that?


I found an aswer on another website:

This is a internal error of Doctrine2, this bug is now fixed but if not :

http://www.doctrine-project.org/jira/browse/DDC-1381

Just edit the file ClassMetadataFactory.php and replace $className by $class->name on line 343, it will fix the problem.

You will probably get another error but this time, this will come from ur app.

Regards.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜