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

EdmPropertyReferenceExpression::getBase()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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\IPropertyReferenceExpression;
10
use AlgoWeb\ODataMetadata\Interfaces\IProperty;
11
use AlgoWeb\ODataMetadata\Library\EdmElement;
12
13
/**
14
 * Represents an EDM property reference expression.
15
 *
16
 * @package AlgoWeb\ODataMetadata\Library\Expressions
17
 */
18
class EdmPropertyReferenceExpression extends EdmElement implements IPropertyReferenceExpression
19
{
20
21
    /**
22
     * @var IExpression
23
     */
24
    private $baseExpression;
25
    /**
26
     * @var IProperty
27
     */
28
    private $referencedProperty;
29
30
    /**
31
     * Initializes a new instance of the EdmPropertyReferenceExpression class.
32
     * @param IExpression $baseExpression Expression for the structured value containing the referenced property.
33
     * @param IProperty $referencedProperty Referenced property.
34
     */
35
    public function __construct(IExpression $baseExpression, IProperty $referencedProperty)
36
    {
37
        $this->baseExpression = $baseExpression;
38
        $this->referencedProperty = $referencedProperty;
39
    }
40
41
    /**
42
     * @return IProperty
43
     */
44
    public function getReferencedProperty(): IProperty
45
    {
46
        return $this->referencedProperty;
47
    }
48
49
    /**
50
     * @inheritDoc
51
     */
52
    public function getExpressionKind(): ExpressionKind
53
    {
54
        return ExpressionKind::PropertyReference();
55
    }
56
57
    /**
58
     * @inheritDoc
59
     */
60
    public function getBase(): IExpression
61
    {
62
        return $this->baseExpression;
63
    }
64
}