Inheritance: extends Doctrine\Common\EventArgs
Ejemplo n.º 1
0
 /**
  * @param LifecycleEventArgs $args
  */
 public function preUpdate($args)
 {
     $object = $args->getDocument();
     if ($object instanceof UserInterface) {
         $this->updateUserFields($object);
     }
 }
Ejemplo n.º 2
0
 private function handleEvent(LifecycleEventArgs $args)
 {
     $document = $args->getDocument();
     if ($document instanceof UserInterface) {
         if (null === $this->userManager) {
             $this->userManager = $this->container->get('fos_user.user_manager');
         }
         $this->userManager->updateCanonicalFields($document);
         $this->userManager->updatePassword($document);
     }
 }