Doctrine2 Define properties via magic methods
Using Doctrine, is it possible to map to properties which don't actually
exist using magic methods?
I'm doing the mapping with YAML.
For example, if I wanted to map to a property named "demo", but
SomeClass::$demo didn't actually exist. I'd want to some combination of
__get(), __set(), __isset() and __call() to handle $demo (and getDemo()
and setDemo()) and do something else with them.
I've tried setting this up, but I'm getting an error:
Uncaught exception 'ReflectionException' with message 'Property
My\Bundle\DemoBundle\Entity\SomeClass::$demo does not exist'
I'm not sure if there is something special with the ReflectionProperty
that causes it to miss my magic methods, or if I'm maybe missing a magic
function. However, as far as I can tell, ReflectionProperty should
interact with them.
Any ideas?
No comments:
Post a Comment