FlushRamchunk::setIndex()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
4
namespace Manticoresearch\Endpoints\Indices;
5
6
use Manticoresearch\Endpoints\EmulateBySql;
7
use Manticoresearch\Exceptions\RuntimeException;
8
use Manticoresearch\Utils;
9
10
class FlushRamchunk extends EmulateBySql
11
{
12
    use Utils;
13
    /**
14
     * @var string
15
     */
16
    protected $index;
17
18
    public function setBody($params = null)
19
    {
20
21
        if (isset($this->index)) {
22
            return parent::setBody(['query' => "FLUSH RAMCHUNK ".$this->index]);
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)
38
    {
39
        $this->index = $index;
40
    }
41
}
42