コード例 #1
0
ファイル: Repository.php プロジェクト: kevupton/ethereal
 /**
  * Throws the errors as the main exception.
  *
  * @param Ethereal $model
  * @param string $joiner
  * @param string $exception_type
  * @param string $message
  * @return Ethereal
  */
 public function throwErrors(Ethereal $model, $joiner = "\n", $exception_type = "main", $message = "")
 {
     if ($model->errors()->count() > 0) {
         $this->throwException(!empty($message) ? $message : 'Validation Errors: ' . implode($joiner, $model->errors()->all()), $exception_type, array('model' => $model));
     }
     return $model;
 }
コード例 #2
0
 /**
  * Defines the prefix for the table.
  * @param array $attr
  */
 public function __construct($attr = array())
 {
     $this->table = mw_prefix() . $this->table;
     parent::__construct($attr);
 }