| Total Complexity | 5 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 11 | class Set extends EmulateBySql |
||
| 12 | { |
||
| 13 | use Utils; |
||
| 14 | /** |
||
| 15 | * @var string |
||
| 16 | */ |
||
| 17 | protected $cluster; |
||
| 18 | |||
| 19 | public function setBody($params = null) |
||
| 20 | { |
||
| 21 | if (isset($params['variable'])) { |
||
| 22 | return parent::setBody([ |
||
| 23 | 'query' => "SET CLUSTER" . $this->cluster . " GLOBAL '" . $params['variable']['name'], "'=" . |
||
| 24 | (is_numeric($params['variable']['value']) ? |
||
| 25 | $params['variable']['value'] : "'" . $params['variable']['value'] . "'") |
||
| 26 | ]); |
||
| 27 | } |
||
| 28 | throw new RuntimeException('Variable is missing for /cluster/set'); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @return mixed |
||
| 33 | */ |
||
| 34 | public function getCLuster() |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @param mixed $cluster |
||
| 41 | */ |
||
| 42 | public function setCluster($cluster) |
||
| 47 |