Reputation: 424
I have a question regarding doctrine yml file. Is it possible to import a yml configuration file, such as parameters.yml and to use those parameters into the mapping configuration ?
For example here is what I would like to do:
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
Does anyone know if that is possible ?
Upvotes: 1
Views: 718
Reputation: 41934
No, this isn't possible.
However, it looks like Resolving Target Entities is something you might be interested in, as it looks like you're trying to do exactly that.
Doctrine 2.2 includes a new utility called the ResolveTargetEntityListener, that functions by intercepting certain calls inside Doctrine and rewriting targetEntity parameters in your metadata mapping at runtime. It means that in your bundle you are able to use an interface or abstract class in your mappings and expect correct mapping to a concrete entity at runtime.
Upvotes: 1