Hi,

Oops, such a stupid question, sorry I did not realize Events::preFoo is a
class constant, so of course MyFooEntity::preFoo is invalid!
I understood what I wanted to do is possible with:
        $entity = $args->getObject();
        $entityManager = $args->getObjectManager();
        if ($entity instanceof Product) {

I guess passing some variables to listeners constructor (if I don't want to
use Subscriber) is possible with:
$eventManager->addEventListener(array(Events::preUpdate), new
MyEventListener(*$params*));
Please correct me if I am wrong about above.
Passing variables to listeners was limitation of entity listeners if
defined inside entity itself instead of bootstrap.

Just one question: passing some properties/flags from listener to
subscriber is possible?

Thanks,




On Fri, Aug 14, 2015 at 9:27 AM, Nima Sadjadi <[email protected]> wrote:

> Sorry I did a typo with preFoo and postUpdate, actually I meant the entity
> class name. If instead of "Events" I use entity class name like "EntityFoo"
> in costructor of subscriber, is it valid if I want that event only invokes
> via a particular entity?
>

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to