| 1 | <?php |
||
| 3 | class CallToActionBlock extends Block |
||
| 4 | { |
||
| 5 | /** |
||
| 6 | * @return string |
||
| 7 | */ |
||
| 8 | 9 | public function singular_name() |
|
| 12 | |||
| 13 | /** |
||
| 14 | * @return string |
||
| 15 | */ |
||
| 16 | public function plural_name() |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var array |
||
| 23 | */ |
||
| 24 | private static $has_one = [ |
||
| 25 | 'BlockLink' => 'Link', |
||
| 26 | ]; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @return FieldList |
||
| 30 | */ |
||
| 31 | 1 | public function getCMSFields() |
|
| 48 | |||
| 49 | 1 | public function getTitle() |
|
| 55 | } |
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: