我对教义yml文件有疑问。是否可以导入yml配置文件(例如parameters.yml)并将这些参数用于映射配置?
例如,这是我想做的事情:
imports:
- { resource: parameters.yml }
Yunai39\Bundle\SimpleLdapBundle\Entity\RoleLdap:
type: entity
id:
id:
type: integer
id: true
generator:
strategy: AUTO
fields:
roleName:
type: string
length: '255'
manyToMany:
users:
targetEntity: "%user_class%"
mappedBy: roles
有人知道这是否可能吗?
不,这是不可能的。
但是,您似乎可能会对解决目标实体感兴趣,因为您似乎正试图做到这一点。
Doctrine 2.2包含一个称为ResolveTargetEntityListener的新实用程序,其功能是在运行时拦截Doctrine内部的某些调用并在元数据映射中重写targetEntity参数。这意味着在您的包中,您可以在映射中使用接口或抽象类,并期望在运行时正确映射到具体实体。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句