Total Complexity | 5 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class MigrateDiscussionReply implements Batch { |
||
15 | |||
16 | /** |
||
17 | * {@inheritDoc} |
||
18 | */ |
||
19 | public function getVersion() { |
||
20 | return 2017112800; |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * {@inheritDoc} |
||
25 | */ |
||
26 | public function shouldBeSkipped() { |
||
27 | return empty($this->countItems()); |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * {@inheritDoc} |
||
32 | */ |
||
33 | public function countItems() { |
||
34 | |||
35 | $hidden = access_show_hidden_entities(true); |
||
36 | |||
37 | $count = elgg_get_entities([ |
||
38 | 'type' => 'object', |
||
39 | 'subtype' => 'discussion_reply', |
||
40 | 'count' => true, |
||
41 | ]); |
||
42 | |||
43 | access_show_hidden_entities($hidden); |
||
44 | |||
45 | return $count; |
||
1 ignored issue
–
show
|
|||
46 | } |
||
47 | |||
48 | /** |
||
49 | * {@inheritDoc} |
||
50 | */ |
||
51 | public function needsIncrementOffset() { |
||
52 | return false; |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * {@inheritDoc} |
||
57 | */ |
||
58 | public function run(Result $result, $offset) { |
||
69 | } |
||
70 | } |
||
71 |