Passed
Push — master ( 112cee...b68050 )
by Michel
03:20
created

AbstractTransformationCompound::getField()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace TBolier\RethinkQL\Query\Transformation;
5
6
use TBolier\RethinkQL\Query\Logic\GetFieldLogic;
7
use TBolier\RethinkQL\Query\Operation\AbstractOperation;
8
use TBolier\RethinkQL\Query\QueryInterface;
9
10
abstract class AbstractTransformationCompound extends AbstractOperation implements TransformationCompoundInterface
11
{
12
    /**
13
     * @param string $field
14
     * @return TransformationCompoundInterface
15
     */
16
    public function getField(string $field): TransformationCompoundInterface
17
    {
18
        return new GetFieldLogic($this->rethink, $field, $this);
19
    }
20
21
    /**
22
     * @inheritdoc
23
     */
24
    public function isEmpty(): QueryInterface
25
    {
26
        return new IsEmpty($this->rethink, $this);
27
    }
28
29
    /**
30
     * @inheritdoc
31
     */
32
    public function limit($value): TransformationCompoundInterface
33
    {
34
        return new Limit($this->rethink, $this, $value);
35
    }
36
37
    /**
38
     * @inheritdoc
39
     */
40
    public function skip($value): TransformationCompoundInterface
41
    {
42
        return new Skip($this->rethink, $this, $value);
43
    }
44
45
    /**
46
     * @inheritdoc
47
     */
48
    public function orderBy($key): TransformationCompoundInterface
49
    {
50
        return new OrderBy($this->rethink, $this, $key);
51
    }
52
}
53