1 | <?php |
||
8 | class ProductHolder extends Page |
||
9 | { |
||
10 | /** |
||
11 | * @var string |
||
12 | */ |
||
13 | private static $singular_name = 'Product Group'; |
||
14 | |||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | private static $plural_name = 'Product Groups'; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private static $description = 'Display a list of related products'; |
||
24 | |||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | private static $many_many = array( |
||
29 | 'Products' => 'ProductPage' |
||
30 | ); |
||
31 | |||
32 | /** |
||
33 | * @var array |
||
34 | */ |
||
35 | private static $many_many_extraFields = array( |
||
36 | 'Products' => array( |
||
37 | 'SortOrder' => 'Int' |
||
38 | ) |
||
39 | ); |
||
40 | |||
41 | /** |
||
42 | * @var array |
||
43 | */ |
||
44 | private static $allowed_children = array('ProductHolder', 'ProductPage'); |
||
45 | |||
46 | /** |
||
47 | * @return FieldList |
||
48 | */ |
||
49 | 1 | public function getCMSFields() |
|
76 | |||
77 | /** |
||
78 | * @return DataList |
||
79 | */ |
||
80 | 1 | public function Products() |
|
84 | |||
85 | /** |
||
86 | * loadDescendantProductGroupIDListInto function. |
||
87 | * |
||
88 | * @access public |
||
89 | * @param mixed &$idList |
||
90 | * @return void |
||
91 | */ |
||
92 | public function loadDescendantProductGroupIDListInto(&$idList) |
||
107 | |||
108 | /** |
||
109 | * ProductGroupIDs function. |
||
110 | * |
||
111 | * @access public |
||
112 | * @return array |
||
113 | */ |
||
114 | public function ProductGroupIDs() |
||
120 | |||
121 | /** |
||
122 | * Products function. |
||
123 | * |
||
124 | * @access public |
||
125 | * @return array |
||
126 | */ |
||
127 | public function ProductList($limit = 10) |
||
162 | } |
||
163 | |||
167 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.