| Conditions | 4 |
| Paths | 4 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | 8 | public function __get($property) |
|
| 36 | { |
||
| 37 | 8 | if ($this->has($property)) { |
|
| 38 | 8 | return $this->get($property); |
|
| 39 | } |
||
| 40 | |||
| 41 | 1 | if (!$this->get('__model')) { |
|
| 42 | 1 | return; |
|
| 43 | } |
||
| 44 | |||
| 45 | 1 | $model = $this->get('__model'); |
|
| 46 | 1 | $class = explode('\\', $model); |
|
| 47 | |||
| 48 | 1 | if (strtolower(end($class)) === $property) { |
|
| 49 | 1 | $model = new $model(); |
|
| 50 | |||
| 51 | 1 | return $model->find($this->id); |
|
| 52 | } |
||
| 53 | |||
| 54 | 1 | return; |
|
| 55 | } |
||
| 56 | |||
| 67 |