| 1 | <?php |
||
| 9 | trait Errorable |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var array |
||
| 13 | */ |
||
| 14 | protected $arrErrors = array(); |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @return array |
||
| 18 | */ |
||
| 19 | 48 | public function getArrErrors() |
|
| 23 | |||
| 24 | /** |
||
| 25 | * @param $str |
||
| 26 | */ |
||
| 27 | 45 | public function addError($str) |
|
| 28 | { |
||
| 29 | 45 | if ($str == "") { |
|
| 30 | 3 | return; |
|
| 31 | } |
||
| 32 | 45 | $this->arrErrors[] = $str; |
|
| 33 | 45 | } |
|
| 34 | |||
| 35 | /** |
||
| 36 | * @param $add |
||
| 37 | */ |
||
| 38 | 3 | public function addArrErrors($add) |
|
| 39 | { |
||
| 40 | 3 | if (!is_array($add) || count($add) < 1) { |
|
| 41 | 3 | return; |
|
| 42 | } |
||
| 43 | |||
| 44 | 3 | $this->arrErrors = array_merge($this->arrErrors, $add); |
|
| 45 | |||
| 46 | 3 | } |
|
| 47 | |||
| 48 | /** |
||
| 49 | * |
||
| 50 | */ |
||
| 51 | 48 | public function resetErrors() |
|
| 55 | |||
| 56 | /** |
||
| 57 | * @return bool |
||
| 58 | */ |
||
| 59 | 48 | public function hasErrors() |
|
| 67 | } |
||
| 68 |