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