Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
52 | 1 | public function getCMSFields() |
|
53 | { |
||
54 | 1 | $fields = parent::getCMSFields(); |
|
55 | |||
56 | 1 | if ($this->ID) { |
|
57 | 1 | $fields->addFieldsToTab('Root.Options', array( |
|
58 | 1 | GridField::create('Options', 'Product Options', $this->Options(), GridFieldConfig_RecordViewer::create()) |
|
|
|||
59 | 1 | )); |
|
60 | 1 | } |
|
61 | |||
62 | 1 | return $fields; |
|
63 | } |
||
64 | |||
101 |
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: