| Total Complexity | 6 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class LinkDefinition extends BaseDefinition |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * {@inheritdoc} |
||
| 11 | */ |
||
| 12 | public function modelGetter() |
||
| 13 | { |
||
| 14 | switch ($this->field['linkType']) { |
||
| 15 | case 'Entry': |
||
| 16 | $stubPath = __DIR__ . '/stubs/entry.stub'; |
||
| 17 | break; |
||
| 18 | case 'Asset': |
||
| 19 | $stubPath = __DIR__ . '/stubs/asset.stub'; |
||
| 20 | break; |
||
| 21 | default: |
||
| 22 | throw new Exception('Unknown Link items type "' . $this->field['linkType'] . '"'); |
||
| 23 | } |
||
| 24 | |||
| 25 | return self::getStub($stubPath, [ |
||
| 26 | 'field' => $this->id(), |
||
| 27 | 'field_studly' => $this->studlyId(), |
||
| 28 | ]); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * {@inheritdoc} |
||
| 33 | */ |
||
| 34 | public function modelProperty() |
||
| 50 | } |
||
| 51 | } |
||
| 52 |