Le 22/01/2011 12:12, Carlos Sánchez a écrit :
Hi all,
I'm experimenting with doctrine entity life cyle events.
As explained in
http://docs.symfony-reloaded.org/master/guides/doctrine/orm/configuration.html,
i've created a listener and subscribed it to dbal using DIC. no
problem, works great!
The problem is that within the listener I have to work at Unit Of Work
Level, not at entity level (I might be wrong at this)
To make things simpler I just created using yaml annotation and as
explained in
http://www.doctrine-project.org/docs/orm/2.0/en/reference/events.html#lifecycle-callbacks
some callbacks on persist event:
....
lifecycleCallbacks:
doStuffOnPrePersist: prePersist
...
when generating entities using console doctrine:generate:entities I
get the following error:
Warning: Invalid argument supplied for foreach() in /var/www/symfony-
sandbox/src/vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/
YamlDriver.php on line 414
And of course method callback is never called.
is YamlDriver parsing or no parsing lifecycleCallbacks properly?
Any idea.
Thanks in advanced.
The YAML driver understands the lifecycleCallbacks but with a different
notation. This page of the doc is outdated. The good syntax is
documented on the page about YAML mapping:
http://www.doctrine-project.org/docs/orm/2.0/en/reference/yaml-mapping.html
Regards
--
Christophe | Stof
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en