【发布时间】:2013-05-18 12:36:20
【问题描述】:
当我使用代码生成捆绑实体时
php app/console doctrine:generate:entities EnsJobeetBundle
我收到了这个错误
[Doctrine\Common\Persistence\Mapping\MappingException] 类“Ens\JobeetBundle\Entity\Affiliate”的映射文件“Ens.JobeetBundle.Entity.Affiliate.orm.yml”无效。
这是 Affiliate.orm.yml 文件:
Ens\JobeetBundle\Entity\Affiliate:
type: entity
table: affiliate
id:
id:
type: integer
generator: { strategy: AUTO }
fields:
url:
type: string
length: 255
email:
type: string
length: 255
unique: true
token:
type: string
length: 255
created_at:
type: datetime
oneToMany:
category_affiliates:
targetEntity: CategoryAffiliate
mappedBy: affiliate
lifecycleCallbacks:
prePersist: [ setCreatedAtValue ]
【问题讨论】:
-
你应该正确缩进你的 yml 文件
-
教程在哪里?(url)
标签: php symfony mapping symfony-2.1 jobeet