1 | <?php |
||
3 | class AccordionBlock extends Block |
||
4 | { |
||
5 | /** |
||
6 | * @var string |
||
7 | */ |
||
8 | private static $singular_name = 'Accordion Block'; |
||
9 | |||
10 | /** |
||
11 | * @var string |
||
12 | */ |
||
13 | private static $plural_name = 'Accordion Blocks'; |
||
14 | |||
15 | /** |
||
16 | * @var array |
||
17 | */ |
||
18 | private static $db = array( |
||
19 | 'Content' => 'HTMLText', |
||
20 | 'SortOrder' => 'Int', |
||
21 | ); |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | private static $has_many = array( |
||
27 | 'Panels' => 'AccordionPanel', |
||
28 | ); |
||
29 | |||
30 | /** |
||
31 | * @return FieldList |
||
32 | */ |
||
33 | 1 | public function getCMSFields() |
|
58 | |||
59 | /** |
||
60 | * @param null $member |
||
61 | * @return bool|null |
||
62 | */ |
||
63 | 1 | public function canCreate($member = null) |
|
77 | |||
78 | /** |
||
79 | * @param null $member |
||
80 | * @return bool|null |
||
81 | */ |
||
82 | 1 | public function canView($member = null) |
|
96 | } |
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: