Ejemplo n.º 1
0
 /**
  * @param EventInterface    $event
  * @param null|callable     $callback
  * @throws \Exception
  */
 public function trigger($event, $callback = null)
 {
     try {
         $this->manager->trigger($event, null, null, $callback);
     } catch (\Exception $ex) {
         $this->logger->error($ex);
         throw $ex;
     }
 }
Ejemplo n.º 2
0
Archivo: Acl.php Proyecto: qshurick/acl
 /**
  * @param int $userId
  */
 public function setUserId($userId)
 {
     if ($userId !== $this->currentUserId) {
         static::$logger->debug("User changed '" . $this->currentUserId . "' > '{$userId}'");
         $this->currentUserId = $userId;
         try {
             $this->setCurrentUserRole($this->getAdapter()->getUserRoleById($userId));
         } catch (\Exception $ex) {
             static::$logger->error($ex);
             $this->setCurrentUserRole(static::DEFAULT_ROLE);
         }
     }
 }