Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
49 | public function setAttribute(string $attribute, $value): void |
||
50 | { |
||
51 | assert($this instanceof ModelInterface); |
||
52 | if ($this->getModelsMetaData()->hasAttribute($this, $attribute)) { |
||
53 | |||
54 | $method = 'set' . ucfirst(Text::camelize($attribute)); |
||
55 | if (method_exists($this, $method)) { |
||
56 | $this->$method(); |
||
57 | } |
||
58 | |||
59 | $this->writeAttribute($attribute, $value); |
||
60 | } |
||
63 |