1 | <?php |
||
16 | class CMSTreeNode extends ViewableData |
||
17 | { |
||
18 | |||
19 | /** |
||
20 | * Object represented by this node |
||
21 | * |
||
22 | * @var SiteTree |
||
23 | */ |
||
24 | protected $obj; |
||
25 | |||
26 | /** |
||
27 | * Edit link to the current record in the CMS |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $link; |
||
32 | |||
33 | /** |
||
34 | * True if this is the currently selected node in the tree |
||
35 | * |
||
36 | * @var bool |
||
37 | */ |
||
38 | protected $isCurrent; |
||
39 | |||
40 | /** |
||
41 | * Name of method to count the number of children |
||
42 | * |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $numChildrenMethod; |
||
46 | |||
47 | /** |
||
48 | * |
||
49 | * @var LeftAndMain_SearchFilter |
||
50 | */ |
||
51 | protected $filter; |
||
52 | |||
53 | /** |
||
54 | * @param Object $obj |
||
55 | * @param string $link |
||
56 | * @param bool $isCurrent |
||
57 | * @param string $numChildrenMethod |
||
58 | * @param LeftAndMain_SearchFilter $filter |
||
59 | */ |
||
60 | public function __construct( |
||
74 | |||
75 | /** |
||
76 | * Returns template, for further processing by {@link Hierarchy->getChildrenAsUL()}. |
||
77 | * Does not include closing tag to allow this method to inject its own children. |
||
78 | * |
||
79 | * @todo Remove hardcoded assumptions around returning an <li>, by implementing recursive tree node rendering |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | public function forTemplate() |
||
102 | |||
103 | /** |
||
104 | * Determine the CSS classes to apply to this node |
||
105 | * |
||
106 | * @return string |
||
107 | */ |
||
108 | public function getClasses() |
||
134 | |||
135 | /** |
||
136 | * Get page backing this node |
||
137 | * |
||
138 | * @return SiteTree |
||
139 | */ |
||
140 | public function getObj() |
||
144 | |||
145 | /** |
||
146 | * Set object backing this node |
||
147 | * |
||
148 | * @param SiteTree $obj |
||
149 | * @return $this |
||
150 | */ |
||
151 | public function setObj($obj) |
||
156 | |||
157 | /** |
||
158 | * Get link to this node |
||
159 | * |
||
160 | * @return string |
||
161 | */ |
||
162 | public function getLink() |
||
166 | |||
167 | /** |
||
168 | * Set link to this node |
||
169 | * |
||
170 | * @param string $link |
||
171 | * @return $this |
||
172 | */ |
||
173 | public function setLink($link) |
||
178 | |||
179 | /** |
||
180 | * Check if this is the currently selected node |
||
181 | * |
||
182 | * @return bool |
||
183 | */ |
||
184 | public function getIsCurrent() |
||
188 | |||
189 | /** |
||
190 | * Set this node to current, or not current |
||
191 | * |
||
192 | * @param bool $bool |
||
193 | * @return $this |
||
194 | */ |
||
195 | public function setIsCurrent($bool) |
||
200 | } |
||
201 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: