| Conditions | 6 |
| Paths | 9 |
| Total Lines | 27 |
| Code Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 7 | public function __set(string $prop,$value) |
||
| 8 | { |
||
| 9 | if(is_array($value)){ |
||
| 10 | $attr = array_keys($value)[0]; |
||
| 11 | $this->data[$prop][$attr] = $value[$attr]; |
||
|
|
|||
| 12 | return $this; |
||
| 13 | } |
||
| 14 | |||
| 15 | if($this->full){ |
||
| 16 | switch($this->data[$prop]['type']){ |
||
| 17 | case 'date': |
||
| 18 | $value = (date_format( date_create_from_format(DATAMANAGER_CONFIG['dateformat'],$value) , 'Y-m-d')); |
||
| 19 | break; |
||
| 20 | case 'datetime': |
||
| 21 | $value = (date_format( date_create_from_format(DATAMANAGER_CONFIG['datetimeformat'],$value) , 'Y-m-d H:i:s')); |
||
| 22 | break; |
||
| 23 | } |
||
| 24 | } |
||
| 25 | |||
| 26 | $this->isSettable($prop); |
||
| 27 | |||
| 28 | $this->data[$prop]['changed'] = ($prop === $this->primary) ? false : true; |
||
| 29 | $this->data[$prop]['value'] = $value; |
||
| 30 | |||
| 31 | $this->$prop = $value; |
||
| 32 | |||
| 33 | return $this; |
||
| 34 | } |
||
| 57 | } |