1 | <?php |
||
13 | class Item |
||
14 | { |
||
15 | /** |
||
16 | * The parent CHM instance. |
||
17 | * |
||
18 | * @var CHM |
||
19 | */ |
||
20 | protected $chm; |
||
21 | |||
22 | /** |
||
23 | * The name of the tree item. |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $name; |
||
28 | |||
29 | /** |
||
30 | * The keyword of the tree item. |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $keyword; |
||
35 | |||
36 | /** |
||
37 | * The value of the "See Also" parameter. |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $seeAlso; |
||
42 | |||
43 | /** |
||
44 | * The local path to the tree item. |
||
45 | * |
||
46 | * @var string |
||
47 | */ |
||
48 | protected $local; |
||
49 | |||
50 | /** |
||
51 | * The URL to the tree item. |
||
52 | * |
||
53 | * @var string |
||
54 | */ |
||
55 | protected $url; |
||
56 | |||
57 | /** |
||
58 | * The path to an entry in another CHM file. |
||
59 | * |
||
60 | * @var array|null If not null, it's an array with two keys: 'chm' and 'entry'. |
||
61 | */ |
||
62 | protected $merge; |
||
63 | |||
64 | /** |
||
65 | * The image number attribute. |
||
66 | * |
||
67 | * @var int|null |
||
68 | */ |
||
69 | protected $imageNumber; |
||
70 | |||
71 | /** |
||
72 | * The sub-elements of this Item. |
||
73 | * |
||
74 | * @var Tree |
||
75 | */ |
||
76 | protected $children; |
||
77 | |||
78 | /** |
||
79 | * Initializes the instance. |
||
80 | * |
||
81 | * @param CHM $chm The parent CHM instance. |
||
82 | * @param DOMElement $object The OBJECT element. |
||
83 | * |
||
84 | * @throws Exception Throw an Exception in case of errors. |
||
85 | * |
||
86 | * @return static |
||
|
|||
87 | */ |
||
88 | public function __construct(CHM $chm, DOMElement $object) |
||
139 | |||
140 | /** |
||
141 | * Get the name of the tree item. |
||
142 | * |
||
143 | * @return string |
||
144 | */ |
||
145 | public function getName() |
||
149 | |||
150 | /** |
||
151 | * Get the keyword of the tree item. |
||
152 | * |
||
153 | * @return string |
||
154 | */ |
||
155 | public function getKeyword() |
||
159 | |||
160 | /** |
||
161 | * Get the value of the "See Also" parameter. |
||
162 | * |
||
163 | * @return string |
||
164 | */ |
||
165 | public function getSeeAlso() |
||
169 | |||
170 | /** |
||
171 | * Get the local path to the tree item. |
||
172 | * |
||
173 | * @return string |
||
174 | */ |
||
175 | public function getLocal() |
||
179 | |||
180 | /** |
||
181 | * Get the URL to the tree item. |
||
182 | * |
||
183 | * @return string |
||
184 | */ |
||
185 | public function getURL() |
||
189 | |||
190 | /** |
||
191 | * Get the path to an entry in another CHM file. |
||
192 | * |
||
193 | * @var array|null If not null, it's an array with two keys: 'chm' and 'entry'. |
||
194 | */ |
||
195 | public function getMerge() |
||
199 | |||
200 | /** |
||
201 | * Get the image number attribute. |
||
202 | * |
||
203 | * @return int|null |
||
204 | */ |
||
205 | public function getImageNumber() |
||
209 | |||
210 | /** |
||
211 | * Get the sub-elements of this Item. |
||
212 | * |
||
213 | * @return Tree |
||
214 | */ |
||
215 | public function getChildren() |
||
219 | |||
220 | /** |
||
221 | * Resolve the items contained in other CHM files. |
||
222 | * |
||
223 | * @param Map $map |
||
224 | * |
||
225 | * @throws Exception Throw an Exception in case of errors. |
||
226 | * |
||
227 | * @return static[] |
||
228 | */ |
||
229 | public function resolve(Map $map) |
||
249 | } |
||
250 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.