1 | <?php |
||
6 | class Reindex |
||
7 | { |
||
8 | const VERSION_TYPE = 'version_type'; |
||
9 | const VERSION_TYPE_INTERNAL = 'internal'; |
||
10 | const VERSION_TYPE_EXTERNAL = 'external'; |
||
11 | const OPERATION_TYPE = 'op_type'; |
||
12 | const OPERATION_TYPE_CREATE = 'create'; |
||
13 | const CONFLICTS = 'conflicts'; |
||
14 | const CONFLICTS_PROCEED = 'proceed'; |
||
15 | const TYPE = 'type'; |
||
16 | const SIZE = 'size'; |
||
17 | const QUERY = 'query'; |
||
18 | |||
19 | /** |
||
20 | * @var Index |
||
21 | */ |
||
22 | protected $_oldIndex; |
||
23 | |||
24 | /** |
||
25 | * @var Index |
||
26 | */ |
||
27 | protected $_newIndex; |
||
28 | |||
29 | /** |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $_options; |
||
33 | |||
34 | public function __construct(Index $oldIndex, Index $newIndex, array $options = []) |
||
40 | |||
41 | public function run() |
||
53 | |||
54 | protected function _getBody($oldIndex, $newIndex, $options) |
||
63 | |||
64 | protected function _getSourcePartBody(Index $index, array $options) |
||
75 | |||
76 | protected function _getDestPartBody(Index $index, array $options) |
||
82 | |||
83 | private function _resolveSourceOptions(array $options) |
||
90 | |||
91 | private function _resolveDestOptions(array $options) |
||
98 | |||
99 | private function _resolveBodyOptions(array $options) |
||
106 | |||
107 | /** |
||
108 | * @param array $sourceBody |
||
109 | * |
||
110 | * @return array |
||
111 | */ |
||
112 | private function _setSourceQuery(array $sourceBody) |
||
119 | |||
120 | /** |
||
121 | * @param array $sourceBody |
||
122 | * |
||
123 | * @return array |
||
124 | */ |
||
125 | private function _setSourceType(array $sourceBody) |
||
139 | } |
||
140 |