当我用代码生成捆绑实体时
php app/console doctrine:generate:entities EnsJobeetBundle
我收到这个错误
[学说\通用\持久性\映射\映射异常]
类“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 ]
尝试在文本编辑器中打开该文件,并将“”全局替换为“”。
我的同事在同一个文件上遇到了完全相同的问题,结果发现问题是该文件使用了空格以外的其他内容作为空格。file(1)
显示该文件是 UTF-8 Unicode 文本而不是纯 ASCII。
我相信这可能是由于复制+粘贴的来源使用不同的空格字符造成的。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)