Conditions | 4 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
23 | public function getValidationRules() |
||
24 | { |
||
25 | $rules = parent::getValidationRules(); |
||
26 | |||
27 | if ($this->isNotRequiredWithUpdate() && $this->getModel()->exists) { |
||
28 | if (($key = array_search('required', $rules[$this->getName()])) !== false) { |
||
29 | unset($rules[$this->getName()][$key]); |
||
30 | } |
||
31 | } |
||
32 | |||
33 | return $rules; |
||
34 | } |
||
35 | |||
71 |