/** * 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); }
/** * 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); }
/** * 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."); }
public function __construct($path = null, $message = "", $code = 0, $previous = null) { parent::__construct($message, $code, $previous); $this->path = $path; }