Total Complexity | 5 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
14 | class Optimize extends EmulateBySql |
||
15 | { |
||
16 | use Utils; |
||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $index; |
||
21 | |||
22 | public function setBody($params = null) |
||
23 | { |
||
24 | if (isset($this->index)) { |
||
25 | return parent::setBody(['query' => "OPTIMIZE INDEX ".$this->index. "". |
||
26 | (isset($params['sync'])?" OPTION sync='".$params['sync']."'":"")]); |
||
27 | } |
||
28 | throw new RuntimeException('Index name is missing.'); |
||
29 | } |
||
30 | /** |
||
31 | * @return mixed |
||
32 | */ |
||
33 | public function getIndex() |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * @param mixed $index |
||
40 | */ |
||
41 | public function setIndex($index) |
||
44 | } |
||
45 | } |
||
46 |