Completed
Push — master ( 175b65...c73746 )
by Alex
18s queued 15s
created

EdmValueTermReferenceExpression   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 58
rs 10
wmc 5

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getTerm() 0 3 1
A getBase() 0 3 1
A getQualifier() 0 3 1
A __construct() 0 5 1
A getExpressionKind() 0 3 1
1
<?php
2
3
4
namespace AlgoWeb\ODataMetadata\Library\Expressions;
5
6
7
use AlgoWeb\ODataMetadata\Enums\ExpressionKind;
8
use AlgoWeb\ODataMetadata\Interfaces\Expressions\IExpression;
9
use AlgoWeb\ODataMetadata\Interfaces\Expressions\IValueTermReferenceExpression;
10
use AlgoWeb\ODataMetadata\Interfaces\IValueTerm;
11
use AlgoWeb\ODataMetadata\Library\EdmElement;
12
13
/**
14
 * Represents an EDM value term reference expression.
15
 *
16
 * @package AlgoWeb\ODataMetadata\Library\Expressions
17
 */
18
class EdmValueTermReferenceExpression extends EdmElement implements IValueTermReferenceExpression
19
{
20
21
    /**
22
     * @var IExpression
23
     */
24
    private $baseExpression;
25
    /**
26
     * @var IValueTerm
27
     */
28
        private $term;
29
    /**
30
     * @var string
31
     */
32
        private $qualifier;
33
34
    /**
35
     * Initializes a new instance of the EdmValueTermReferenceExpression class.
36
     * @param IExpression $baseExpression Expression for the structured value containing the referenced term property.
37
     * @param IValueTerm $term Referenced value term.
38
     * @param string $qualifier Qualifier
39
     */
40
    public function __construct(IExpression $baseExpression, IValueTerm $term, string $qualifier = null)
41
    {
42
        $this->baseExpression = $baseExpression;
43
        $this->term = $term;
44
        $this->qualifier = $qualifier;
45
    }
46
    /**
47
     * @inheritDoc
48
     */
49
    public function getBase(): IExpression
50
    {
51
        return $this->baseExpression;
52
    }
53
54
    /**
55
     * @inheritDoc
56
     */
57
    public function getTerm(): IValueTerm
58
    {
59
        return $this->term;
60
    }
61
62
    /**
63
     * @inheritDoc
64
     */
65
    public function getQualifier(): string
66
    {
67
        return $this->qualifier;
68
    }
69
70
    /**
71
     * @inheritDoc
72
     */
73
    public function getExpressionKind(): ExpressionKind
74
    {
75
        return ExpressionKind::ValueTermReference();
76
    }
77
78
}