Passed
Push — master ( 4f7966...46bec3 )
by Alex
04:29
created

TModificationFunctionMappingAssociationEndType::setScalarProperty()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace AlgoWeb\ODataMetadata\MetadataV3\mapping\cs;
4
5
use AlgoWeb\ODataMetadata\IsOK;
6
use AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\Groups\TModificationFunctionMappingAssociationEndPropertyGroup;
7
use AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\IsOKTraits\TSimpleIdentifierTrait;
8
9
/**
10
 * Class representing TModificationFunctionMappingAssociationEndType
11
 *
12
 * Type for function mapping association end
13
 *
14
 * XSD Type: TModificationFunctionMappingAssociationEnd
15
 */
16
class TModificationFunctionMappingAssociationEndType extends IsOK
17
{
18
    use TSimpleIdentifierTrait, TModificationFunctionMappingAssociationEndPropertyGroup;
19
    /**
20
     * @property string $associationSet
21
     */
22
    private $associationSet = null;
23
24
    /**
25
     * @property string $from
26
     */
27
    private $from = null;
28
29
    /**
30
     * @property string $to
31
     */
32
    private $to = null;
33
34
    /**
35
     * Gets as associationSet
36
     *
37
     * @return string
38
     */
39
    public function getAssociationSet()
40
    {
41
        return $this->associationSet;
42
    }
43
44
    /**
45
     * Sets a new associationSet
46
     *
47
     * @param string $associationSet
48
     * @return self
49
     */
50
    public function setAssociationSet($associationSet)
51
    {
52
        $this->associationSet = $associationSet;
53
        return $this;
54
    }
55
56
    /**
57
     * Gets as from
58
     *
59
     * @return string
60
     */
61
    public function getFrom()
62
    {
63
        return $this->from;
64
    }
65
66
    /**
67
     * Sets a new from
68
     *
69
     * @param string $from
70
     * @return self
71
     */
72
    public function setFrom($from)
73
    {
74
        $this->from = $from;
75
        return $this;
76
    }
77
78
    /**
79
     * Gets as to
80
     *
81
     * @return string
82
     */
83
    public function getTo()
84
    {
85
        return $this->to;
86
    }
87
88
    /**
89
     * Sets a new to
90
     *
91
     * @param string $to
92
     * @return self
93
     */
94
    public function setTo($to)
95
    {
96
        $this->to = $to;
97
        return $this;
98
    }
99
100
    public function isOK(&$msg = null)
101
    {
102
        if (!$this->isStringNotNullOrEmpty($this->associationSet)) {
103
            $msg = 'Association set cannot be null or empty';
104
            return false;
105
        }
106
        if (!$this->isStringNotNullOrEmpty($this->from)) {
107
            $msg = 'From cannot be null or empty';
108
            return false;
109
        }
110
        if (!$this->isStringNotNullOrEmpty($this->to)) {
111
            $msg = 'To cannot be null or empty';
112
            return false;
113
        }
114
        if (!$this->isModificationFunctionMappingAssociationOK($msg)) {
115
            return false;
116
        }
117
        return true;
118
    }
119
}
120