1 | <?php |
||
3 | namespace Dynamic\DynamicBlocks\Block; |
||
4 | |||
5 | use Dynamic\DynamicBlocks\Model\AccordionPanel; |
||
6 | use League\Flysystem\Config; |
||
7 | use SheaDawson\Blocks\Controllers\BlockController; |
||
8 | 12 | use SheaDawson\Blocks\Model\Block; |
|
9 | use SilverStripe\Forms\GridField\GridField; |
||
10 | 12 | use SilverStripe\Forms\GridField\GridFieldConfig_RecordEditor; |
|
11 | use SilverStripe\Forms\GridField\GridFieldDeleteAction; |
||
12 | use SilverStripe\View\Requirements; |
||
13 | use Symbiote\GridFieldExtensions\GridFieldOrderableRows; |
||
14 | |||
15 | class AccordionBlock extends Block |
||
16 | 1 | { |
|
17 | /** |
||
18 | 1 | * @return string |
|
19 | */ |
||
20 | public function singular_name() |
||
24 | |||
25 | /** |
||
26 | * @return string |
||
27 | */ |
||
28 | public function plural_name() |
||
32 | |||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | private static $db = array( |
||
37 | 'Content' => 'HTMLText', |
||
38 | 'SortOrder' => 'Int', |
||
39 | 1 | ); |
|
40 | |||
41 | 1 | /** |
|
42 | * @var array |
||
43 | 1 | */ |
|
44 | 1 | private static $has_many = array( |
|
45 | 1 | 'Panels' => AccordionPanel::class, |
|
46 | 1 | ); |
|
47 | |||
48 | 1 | /** |
|
49 | 1 | * @return FieldList |
|
50 | 1 | */ |
|
51 | 1 | public function getCMSFields() |
|
120 | } |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: