Total Complexity | 6 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class ArrayDefinition extends BaseDefinition |
||
8 | { |
||
9 | /** |
||
10 | * {@inheritdoc} |
||
11 | */ |
||
12 | public function modelGetter() |
||
13 | { |
||
14 | switch ($this->field['items']['type']) { |
||
15 | case 'Link': |
||
16 | $stubPath = __DIR__ . '/stubs/entries.stub'; |
||
17 | break; |
||
18 | case 'Symbol': |
||
19 | $stubPath = __DIR__ . '/stubs/string.stub'; |
||
20 | break; |
||
21 | default: |
||
22 | throw new Exception('Unknown Array items type "' . $this->field['items']['type'] . '"'); |
||
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 |