1 | <?php |
||
3 | class ProductDocDataExtension extends DataExtension |
||
4 | { |
||
5 | /** |
||
6 | * @var array |
||
7 | */ |
||
8 | private static $belongs_many_many = array( |
||
9 | 'Products' => 'CatalogProduct', |
||
10 | ); |
||
11 | |||
12 | /** |
||
13 | * @var array |
||
14 | */ |
||
15 | private static $summary_fields = array( |
||
16 | 'Name' => 'Name', |
||
17 | 'Title' => 'Title', |
||
18 | 'ProductsCt' => 'Products', |
||
19 | ); |
||
20 | |||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | private static $searchable_fields = array( |
||
25 | 'Name', |
||
26 | 'Title', |
||
27 | 'Products.ID', |
||
28 | ); |
||
29 | |||
30 | /** |
||
31 | * @return int |
||
32 | */ |
||
33 | 5 | public function getProductsCt() |
|
40 | |||
41 | /** |
||
42 | * @return string |
||
43 | */ |
||
44 | 1 | public function getProductsList() |
|
59 | |||
60 | /** |
||
61 | * @param FieldList $fields |
||
62 | */ |
||
63 | 5 | public function updateCMSFields(FieldList $fields) |
|
103 | |||
104 | /** |
||
105 | * Link for searchable result set |
||
106 | * |
||
107 | * @return mixed |
||
108 | */ |
||
109 | 1 | public function Link() |
|
113 | |||
114 | /** |
||
115 | * @return bool |
||
116 | */ |
||
117 | 1 | public function getIsProductDoc() { |
|
120 | } |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.