1 | <?php |
||
37 | class QueueRepository extends AbstractRepository |
||
38 | { |
||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | protected $tableName = 'tx_crawler_queue'; |
||
43 | |||
44 | /** |
||
45 | * This method is used to find the youngest entry for a given process. |
||
46 | * |
||
47 | * @param Process $process |
||
48 | * |
||
49 | * @return Queue $entry |
||
50 | */ |
||
51 | 1 | public function findYoungestEntryForProcess(Process $process) |
|
55 | |||
56 | /** |
||
57 | * This method is used to find the oldest entry for a given process. |
||
58 | * |
||
59 | * @param Process $process |
||
60 | * |
||
61 | * @return Queue |
||
62 | */ |
||
63 | 1 | public function findOldestEntryForProcess(Process $process) |
|
67 | |||
68 | /** |
||
69 | * This internal helper method is used to create an instance of an entry object |
||
70 | * |
||
71 | * @param Process $process |
||
72 | * @param string $orderby first matching item will be returned as object |
||
73 | * |
||
74 | * @return Queue |
||
75 | */ |
||
76 | 5 | protected function getFirstOrLastObjectByProcess($process, $orderby) |
|
94 | |||
95 | /** |
||
96 | * Counts all executed items of a process. |
||
97 | * |
||
98 | * @param Process $process |
||
99 | * |
||
100 | * @return int |
||
101 | */ |
||
102 | 1 | public function countExecutedItemsByProcess($process) |
|
109 | |||
110 | /** |
||
111 | * Counts items of a process which yet have not been processed/executed |
||
112 | * |
||
113 | * @param Process $process |
||
114 | * |
||
115 | * @return int |
||
116 | */ |
||
117 | 1 | public function countNonExecutedItemsByProcess($process) |
|
124 | |||
125 | /** |
||
126 | * Method to determine unprocessed Items in the crawler queue. |
||
127 | * |
||
128 | * @return array |
||
129 | */ |
||
130 | 2 | public function getUnprocessedItems() |
|
142 | |||
143 | /** |
||
144 | * Count items which have not been processed yet |
||
145 | * |
||
146 | * @return int |
||
147 | */ |
||
148 | 2 | public function countUnprocessedItems() |
|
152 | |||
153 | /** |
||
154 | * This method can be used to count all queue entrys which are |
||
155 | * scheduled for now or a earlier date. |
||
156 | * |
||
157 | * @return int |
||
158 | */ |
||
159 | 2 | public function countAllPendingItems() |
|
163 | |||
164 | /** |
||
165 | * This method can be used to count all queue entrys which are |
||
166 | * scheduled for now or a earlier date and are assigned to a process. |
||
167 | * |
||
168 | * @return int |
||
169 | */ |
||
170 | 2 | public function countAllAssignedPendingItems() |
|
174 | |||
175 | /** |
||
176 | * This method can be used to count all queue entrys which are |
||
177 | * scheduled for now or a earlier date and are not assigned to a process. |
||
178 | * |
||
179 | * @return int |
||
180 | */ |
||
181 | 1 | public function countAllUnassignedPendingItems() |
|
185 | |||
186 | /** |
||
187 | * Internal method to count items by a given where clause |
||
188 | * |
||
189 | * @param string $where |
||
190 | * |
||
191 | * @return mixed |
||
192 | */ |
||
193 | 8 | protected function countItemsByWhereClause($where) |
|
201 | |||
202 | /** |
||
203 | * Count pending queue entries grouped by configuration key |
||
204 | * |
||
205 | * @return array |
||
206 | */ |
||
207 | 1 | public function countPendingItemsGroupedByConfigurationKey() |
|
223 | |||
224 | /** |
||
225 | * Get set id with unprocessed entries |
||
226 | * |
||
227 | * @param void |
||
228 | * |
||
229 | * @return array array of set ids |
||
230 | */ |
||
231 | 1 | public function getSetIdWithUnprocessedEntries() |
|
247 | |||
248 | /** |
||
249 | * Get total queue entries by configuration |
||
250 | * |
||
251 | * @param array $setIds |
||
252 | * |
||
253 | * @return array totals by configuration (keys) |
||
254 | */ |
||
255 | 1 | public function getTotalQueueEntriesByConfiguration(array $setIds) |
|
273 | |||
274 | /** |
||
275 | * Get the timestamps of the last processed entries |
||
276 | * |
||
277 | * @param int $limit |
||
278 | * |
||
279 | * @return array |
||
280 | */ |
||
281 | 1 | public function getLastProcessedEntriesTimestamps($limit = 100) |
|
300 | |||
301 | /** |
||
302 | * Get the last processed entries |
||
303 | * |
||
304 | * @param string $selectFields |
||
305 | * @param int $limit |
||
306 | * |
||
307 | * @return array |
||
308 | */ |
||
309 | 1 | public function getLastProcessedEntries($selectFields = '*', $limit = 100) |
|
328 | |||
329 | /** |
||
330 | * Get performance statistics data |
||
331 | * |
||
332 | * @param int $start timestamp |
||
333 | * @param int $end timestamp |
||
334 | * |
||
335 | * @return array performance data |
||
336 | */ |
||
337 | 1 | public function getPerformanceData($start, $end) |
|
354 | |||
355 | /** |
||
356 | * Determines if a page is queued |
||
357 | * |
||
358 | * @param $uid |
||
359 | * @param bool $unprocessed_only |
||
360 | * @param bool $timed_only |
||
361 | * @param bool $timestamp |
||
362 | * |
||
363 | * @return bool |
||
364 | */ |
||
365 | 7 | public function isPageInQueue($uid, $unprocessed_only = true, $timed_only = false, $timestamp = false) |
|
399 | |||
400 | /** |
||
401 | * Method to check if a page is in the queue which is timed for a |
||
402 | * date when it should be crawled |
||
403 | * |
||
404 | * @param int $uid uid of the page |
||
405 | * |
||
406 | * @return boolean |
||
407 | * |
||
408 | */ |
||
409 | 1 | public function isPageInQueueTimed($uid) |
|
414 | |||
415 | /** |
||
416 | * This method is used to count all processes in the process table. |
||
417 | * |
||
418 | * @param string $where Where clause |
||
419 | * |
||
420 | * @return integer |
||
421 | */ |
||
422 | 8 | public function countAll($where = '1 = 1') |
|
426 | } |
||
427 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.