예제 #1
0
 /**
  * LockedException
  *
  * @param   int       $lockedBy          Id of User that add a lock to the object
  * @param   mixed     $object   optional Locked object
  * @param   string    $comment  optional Lock comment
  * @param   int       $code     optional The Exception code
  * @param   Exception $previous optional The previous exception used for the exception chaining
  */
 public function __construct($lockedBy, $object = null, $comment = '', $code = 0, Exception $previous = null)
 {
     $this->lockedBy = $lockedBy;
     $this->object = $object;
     /* @var  $user User */
     $user = User::findPk($lockedBy);
     $userName = empty($user) ? $lockedBy : $user->email;
     if (!empty($comment)) {
         $comment = " with comment: '{$comment}'";
     }
     if (is_object($object)) {
         $object = array_pop(preg_split('\\', get_class($object)));
     }
     parent::__construct((empty($object) ? "Locked" : "{$object} locked") . " by {$userName}{$comment}", $code, $previous);
 }
예제 #2
0
 /**
  * LockedException
  *
  * @param   int       $lockedBy          Id of User that add a lock to the object
  * @param   mixed     $object   optional Locked object
  * @param   string    $comment  optional Lock comment
  * @param   int       $code     optional The Exception code
  * @param   Exception $previous optional The previous exception used for the exception chaining
  */
 public function __construct($lockedBy, $object = null, $comment = '', $code = 0, Exception $previous = null)
 {
     if (is_array($object)) {
         throw new InvalidArgumentException("Second argument can not be an array");
     }
     $this->lockedBy = $lockedBy;
     $this->object = $object;
     /* @var  $user User */
     $user = User::findPk($lockedBy);
     $userName = empty($user) ? $lockedBy : $user->email;
     if (!empty($comment)) {
         $comment = " with comment: '{$comment}'";
     }
     if (is_object($object)) {
         $nameParts = explode('\\', get_class($object));
         $object = array_pop($nameParts);
     }
     parent::__construct((empty($object) ? "Locked" : "{$object} locked") . " by {$userName}{$comment}", $code, $previous);
 }
예제 #3
0
 /**
  * LimitExceededException
  *
  * @param   string  $limitName  Human readable limit name
  */
 public function __construct($limitName)
 {
     parent::__construct(_("{$limitName} limit exceeded for your account. Please <a href='#/billing'>upgrade your account</a> to higher plan"));
 }
 /**
  * Constructor
  *
  * @param    $message optional Error message
  */
 public function __construct($message = null)
 {
     parent::__construct($message ?: "Invalid cloud credentials.");
 }
예제 #5
0
 public function __construct($path = null, $message = "", $code = 0, $previous = null)
 {
     parent::__construct($message, $code, $previous);
     $this->path = $path;
 }