Example #1
0
 /**
  * コンストラクタ
  *
  * @param $errors 入力エラーのメッセージリスト
  * @param $code この例外のエラーコード
  */
 public function __construct($key, $message)
 {
     if (is_array($message)) {
         foreach ($message as $index => $value) {
             $this->addError($key, $value);
         }
     } else {
         $this->addError($key, $message);
     }
     parent::__construct(implode("\r\n", $this->errors));
 }
Example #2
0
 /**
  * コンストラクタ
  *
  * @param $err この例外の原因となったデータベースの例外
  * @param $code この例外のエラーコード
  */
 public function __construct($err, $code = 0)
 {
     parent::__construct($err->getMessage(), $code, $err);
 }