Total Complexity | 6 |
Total Lines | 62 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
14 | class MigratePageTopRiver implements Batch { |
||
15 | |||
16 | /** |
||
17 | * {@inheritDoc} |
||
18 | */ |
||
19 | public function getVersion() { |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * {@inheritDoc} |
||
25 | */ |
||
26 | public function shouldBeSkipped() { |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * {@inheritDoc} |
||
32 | */ |
||
33 | public function countItems() { |
||
34 | |||
35 | $dbprefix = elgg_get_config('dbprefix'); |
||
36 | |||
37 | $query = "SELECT COUNT(*) as total |
||
38 | FROM {$dbprefix}river |
||
39 | WHERE type = 'object' |
||
40 | AND subtype = 'page_top' |
||
41 | "; |
||
42 | |||
43 | $row = get_data_row($query); |
||
44 | if (empty($row)) { |
||
45 | return 0; |
||
46 | } |
||
47 | |||
48 | return (int) $row->total; |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * {@inheritDoc} |
||
53 | */ |
||
54 | public function needsIncrementOffset() { |
||
55 | return false; |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * {@inheritDoc} |
||
60 | */ |
||
61 | public function run(Result $result, $offset) { |
||
76 | } |
||
77 | } |
||
78 |