Beispiel #1
0
 /**
  * User delete
  * 
  * @trigger Event::EVENT_DELETE
  * @param \Grid\User\Model\User\Structure $user
  * @return boolean
  */
 public function delete(UserStructure $user)
 {
     $event = new Event\Delete();
     $event->setUser($user);
     $this->getEventManager()->trigger($event);
     return $event->getResult();
 }
Beispiel #2
0
 /**
  * Handles delete event
  * 
  * @param \Grid\User\Datasheet\Event\Delete $event
  * @return \Grid\User\Datasheet\Event\Delete
  */
 public function onDelete(Event\Delete $event)
 {
     $success = $event->getUser()->delete();
     $event->setResult((bool) $success);
     if ($event->getResult() === false) {
         $event->stopPropagation(true);
     }
     return $event;
 }