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