Completed
Push — master ( bdd70c...0550f6 )
by Eugene
10:03
created

UpsertRequest::getType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Tarantool\Client\Request;
4
5
use Tarantool\Client\IProto;
6
7
class UpsertRequest implements Request
8
{
9
10
    private $spaceId;
11
    private $values;
12
    private $operations;
13
14
    public function __construct($spaceId, $values, $operations)
15
    {
16
        $this->spaceId = $spaceId;
17
        $this->values = $values;
18
        $this->operations = $operations;
19
    }
20
21
    public function getType()
22
    {
23
        return self::TYPE_UPSERT;
24
    }
25
26
    public function getBody()
27
    {
28
        return [
29
            IProto::SPACE_ID => $this->spaceId,
30
            IProto::TUPLE => $this->values,
31
            IProto::OPERATIONS => $this->operations,
32
        ];
33
    }
34
35
}