Conditions | 1 |
Paths | 1 |
Total Lines | 20 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
25 | 1 | public function getCMSFields() |
|
26 | { |
||
27 | 1 | $fields = parent::getCMSFields(); |
|
28 | |||
29 | 1 | $source = function(){ |
|
30 | 1 | return SilverStripeYouTubeVideo::get()->map()->toArray(); |
|
31 | 1 | }; |
|
32 | |||
33 | |||
34 | 1 | $fields->addFieldToTab( |
|
35 | 1 | 'Root.Main', |
|
36 | 1 | DropdownField::create('VideoID') |
|
37 | 1 | ->setTitle('Video') |
|
38 | 1 | ->setSource($source()) |
|
39 | 1 | ->setEmptyString('') |
|
40 | 1 | ->useAddNew('SilverStripeYouTubeVideo', $source) |
|
41 | 1 | ); |
|
42 | |||
43 | 1 | return $fields; |
|
44 | } |
||
45 | } |
||
46 |