当我使用代码生成捆绑实体时
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 ]