1 | <?php |
||
7 | class Parser extends Connection |
||
8 | { |
||
9 | /** |
||
10 | * @var $xpath |
||
11 | */ |
||
12 | protected $xpath; |
||
13 | |||
14 | /** |
||
15 | * Retrieve amount product sold |
||
16 | * |
||
17 | * @var $sold |
||
18 | */ |
||
19 | public $sold; |
||
20 | |||
21 | /** |
||
22 | * @var $cod |
||
23 | */ |
||
24 | public $cod = false; |
||
25 | |||
26 | /** |
||
27 | * Latest bump attempt time |
||
28 | * |
||
29 | * @var $bump |
||
30 | */ |
||
31 | public $bump; |
||
32 | |||
33 | 1 | function __construct($url) |
|
45 | |||
46 | /** |
||
47 | * Creates DOMXPath object from content |
||
48 | * |
||
49 | * @return object |
||
50 | */ |
||
51 | 1 | protected function document(\DOMDocument $doc) |
|
56 | |||
57 | /** |
||
58 | * Find element from content with xpath expression |
||
59 | * |
||
60 | * @param string $query xpath query expression |
||
61 | * @return bool(false)|DOMNodeList |
||
62 | * @see http://php.net/manual/en/domxpath.query.php |
||
63 | */ |
||
64 | 6 | public function find($query) |
|
68 | |||
69 | /** |
||
70 | * Fetch all result into array |
||
71 | * |
||
72 | * @return array |
||
73 | */ |
||
74 | 1 | public function fetch() |
|
93 | |||
94 | /** |
||
95 | * Get username |
||
96 | * |
||
97 | * @return string |
||
98 | */ |
||
99 | 2 | public function username() |
|
105 | |||
106 | /** |
||
107 | * Get user id |
||
108 | * |
||
109 | * @return int |
||
110 | */ |
||
111 | 2 | public function userID() |
|
123 | |||
124 | /** |
||
125 | * Amount of image of thread |
||
126 | * |
||
127 | * @return int |
||
128 | */ |
||
129 | 2 | public function countImage() |
|
136 | |||
137 | /** |
||
138 | * Get user rank |
||
139 | * |
||
140 | * @return string |
||
141 | */ |
||
142 | 1 | public function rank() |
|
150 | |||
151 | /** |
||
152 | * Get amount of feedback |
||
153 | * |
||
154 | * @return int |
||
155 | */ |
||
156 | 1 | public function feedback() |
|
166 | |||
167 | /** |
||
168 | * Get feedback precentage |
||
169 | * |
||
170 | * @return int |
||
171 | */ |
||
172 | 1 | public function feedbackPercent() |
|
184 | |||
185 | /** |
||
186 | * Retrieve user join date |
||
187 | * |
||
188 | * @return string date |
||
189 | */ |
||
190 | 1 | public function joinDate() |
|
202 | |||
203 | /** |
||
204 | * Check whether verified seller |
||
205 | * |
||
206 | * @return bool |
||
207 | */ |
||
208 | 2 | public function verifiedSeller() |
|
216 | |||
217 | /** |
||
218 | * Find date of thread started |
||
219 | * |
||
220 | * @return string date thread started |
||
221 | */ |
||
222 | 2 | public function threadPublished() |
|
232 | |||
233 | /** |
||
234 | * Return product specified entities |
||
235 | * |
||
236 | * @return array sold, bump, cod |
||
237 | */ |
||
238 | 1 | public function product() |
|
278 | } |
||
279 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.