| 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 | } |
If you implement
__calland 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
__callis implemented by a parent class and only the child class knows which methods exist: