| Total Complexity | 4 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class TestRelationObject extends DataObject implements TestOnly |
||
| 10 | { |
||
| 11 | private static $db = [ |
||
| 12 | 'Title' => 'Varchar(255)' |
||
| 13 | ]; |
||
| 14 | |||
| 15 | private static $has_one = [ |
||
| 16 | 'TestObject' => TestObject::class |
||
| 17 | ]; |
||
| 18 | |||
| 19 | public function canView($member = null) |
||
| 20 | { |
||
| 21 | return true; |
||
| 22 | } |
||
| 23 | |||
| 24 | public function getCow() |
||
| 25 | { |
||
| 26 | return $this->getFarmAnimals()[0]; |
||
| 27 | } |
||
| 28 | |||
| 29 | public function getFarmAnimals() |
||
| 30 | { |
||
| 31 | return ['cow', 'sheep']; |
||
| 32 | } |
||
| 33 | |||
| 34 | public function getSheep() |
||
| 35 | { |
||
| 36 | return $this->getFarmAnimals()[1]; |
||
| 37 | } |
||
| 39 |