| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public function __call($name, $arguments) |
||
| 27 | { |
||
| 28 | if (strpos($name, 'get') === 0) { |
||
| 29 | $property = strtolower(substr($name, 3)); |
||
| 30 | if (property_exists($this, $property)) { |
||
| 31 | $reference = $this->getRepository()->getSpace()->getReference($property); |
||
| 32 | if ($reference) { |
||
| 33 | return $this->getRepository()->getMapper() |
||
| 34 | ->findOrFail($reference, [ |
||
| 35 | 'id' => $this->$property, |
||
| 36 | ]); |
||
| 37 | } |
||
| 38 | } |
||
| 39 | } |
||
| 40 | throw new BadMethodCallException("Call to undefined method ". get_class($this).'::'.$name); |
||
| 41 | } |
||
| 42 | |||
| 56 |