Conditions | 2 |
Paths | 2 |
Total Lines | 26 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
40 | public function start(): bool |
||
41 | { |
||
42 | $this->db->storage->updateMany(['directory' => true, 'filter' => []], [ |
||
43 | '$unset' => [ |
||
44 | 'filter' => 1, |
||
45 | ], |
||
46 | ]); |
||
47 | |||
48 | $cursor = $this->db->storage->find( |
||
49 | [ |
||
50 | 'directory' => true, |
||
51 | 'filter' => ['$type' => 3], ] |
||
52 | ); |
||
53 | |||
54 | foreach ($cursor as $object) { |
||
55 | $filter = json_encode($object['filter']); |
||
56 | $this->db->storage->updateOne( |
||
57 | ['_id' => $object['_id']], |
||
58 | [ |
||
59 | '$set' => ['filter' => $filter], |
||
60 | ] |
||
61 | ); |
||
62 | } |
||
63 | |||
64 | return true; |
||
65 | } |
||
66 | } |
||
67 |