當我生成具有代碼束實體Symfony2的Jobeet的教程天3出錯無效映射
php app/console doctrine:generate:entities EnsJobeetBundle
我得到這個誤差
[學說\共同\持久性\映射\ 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文件 – cheesemacfly
該教程在哪裏?(url) – mpm
http://www.ens.ro/2012/03/21/jobeet-tutorial-with-symfony2/ – tasqyn