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