Total Complexity | 8 |
Total Lines | 56 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | trait HasUniqueValidation |
||
8 | { |
||
9 | protected $unique; |
||
10 | |||
11 | /** |
||
12 | * @param array $columns |
||
13 | * @param string|null $message |
||
14 | * |
||
15 | * @return static |
||
16 | */ |
||
17 | public function unique(array $columns, $message = null) |
||
18 | { |
||
19 | $this->initializeUniqueValidator($message); |
||
20 | $this->unique = $columns; |
||
21 | |||
22 | return $this; |
||
23 | } |
||
24 | |||
25 | protected function initializeUniqueValidator($message = null) |
||
30 | } |
||
31 | |||
32 | public function getValidationRules() |
||
37 | } |
||
38 | |||
39 | protected function addUniqueValidation() |
||
63 | } |
||
64 | } |
||
68 |