My postUpdate function fire only when the change is by a form submit, when the change comes by an update function as the following it wont fire. my post update function :
public function postUpdate(LifecycleEventArgs $args) {
error_log('in post update');
}
the life event declaration :
custom.doctrine.listeer:
class: Custom\CoreBundle\Listeners\CustomDoctrineListener
tags:
- { name: doctrine.event_listener, event: postUpdate, method: postUpdate }
- { name: doctrine.event_listener, event: prePersist, method: prePersist }
the call that don't triggers the the life event :
public function setPrivate($id,$private){
$qb=$this->createQueryBuilder('cc')
->update()
->set('cc.private',$private)
->where('cc.id='.$id);
return $qb->getQuery()->getResult();
}