Passed
Push — master ( bc609e...49bb39 )
by Alex
03:56
created

TMappingFragmentType::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
7
/**
8
 * Class representing TMappingFragmentType
9
 *
10
 *
11
 * XSD Type: TMappingFragment
12
 */
13
class TMappingFragmentType extends IsOK
14
{
15
16
    /**
17
     * @property string $storeEntitySet
18
     */
19
    private $storeEntitySet = null;
20
21
    /**
22
     * @property boolean $makeColumnsDistinct
23
     */
24
    private $makeColumnsDistinct = null;
25
26
    /**
27
     * @property \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TComplexPropertyType $complexProperty
28
     */
29
    private $complexProperty = null;
30
31
    /**
32
     * @property \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TScalarPropertyType $scalarProperty
33
     */
34
    private $scalarProperty = null;
35
36
    /**
37
     * @property \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TConditionType $condition
38
     */
39
    private $condition = null;
40
41
    /**
42
     * Gets as storeEntitySet
43
     *
44
     * @return string
45
     */
46
    public function getStoreEntitySet()
47
    {
48
        return $this->storeEntitySet;
49
    }
50
51
    /**
52
     * Sets a new storeEntitySet
53
     *
54
     * @param string $storeEntitySet
55
     * @return self
56
     */
57
    public function setStoreEntitySet($storeEntitySet)
58
    {
59
        $this->storeEntitySet = $storeEntitySet;
60
        return $this;
61
    }
62
63
    /**
64
     * Gets as makeColumnsDistinct
65
     *
66
     * @return boolean
67
     */
68
    public function getMakeColumnsDistinct()
69
    {
70
        return $this->makeColumnsDistinct;
71
    }
72
73
    /**
74
     * Sets a new makeColumnsDistinct
75
     *
76
     * @param boolean $makeColumnsDistinct
77
     * @return self
78
     */
79
    public function setMakeColumnsDistinct($makeColumnsDistinct)
80
    {
81
        $this->makeColumnsDistinct = $makeColumnsDistinct;
82
        return $this;
83
    }
84
85
    /**
86
     * Gets as complexProperty
87
     *
88
     * @return \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TComplexPropertyType
89
     */
90
    public function getComplexProperty()
91
    {
92
        return $this->complexProperty;
93
    }
94
95
    /**
96
     * Sets a new complexProperty
97
     *
98
     * @param \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TComplexPropertyType $complexProperty
99
     * @return self
100
     */
101
    public function setComplexProperty(TComplexPropertyType $complexProperty)
102
    {
103
        $this->complexProperty = $complexProperty;
104
        return $this;
105
    }
106
107
    /**
108
     * Gets as scalarProperty
109
     *
110
     * @return \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TScalarPropertyType
111
     */
112
    public function getScalarProperty()
113
    {
114
        return $this->scalarProperty;
115
    }
116
117
    /**
118
     * Sets a new scalarProperty
119
     *
120
     * @param \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TScalarPropertyType $scalarProperty
121
     * @return self
122
     */
123
    public function setScalarProperty(TScalarPropertyType $scalarProperty)
124
    {
125
        $this->scalarProperty = $scalarProperty;
126
        return $this;
127
    }
128
129
    /**
130
     * Gets as condition
131
     *
132
     * @return \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TConditionType
133
     */
134
    public function getCondition()
135
    {
136
        return $this->condition;
137
    }
138
139
    /**
140
     * Sets a new condition
141
     *
142
     * @param \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TConditionType $condition
143
     * @return self
144
     */
145
    public function setCondition(TConditionType $condition)
146
    {
147
        $this->condition = $condition;
148
        return $this;
149
    }
150
151 View Code Duplication
    public function isOK(&$msg = null)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
152
    {
153
        if (!$this->isStringNotNullOrEmpty($this->storeEntitySet)) {
154
            $msg = 'Name cannot be null or empty';
155
            return false;
156
        }
157
        if (null != $this->scalarProperty && !$this->scalarProperty->isOK($msg)) {
0 ignored issues
show
Bug introduced by
The method isOK() cannot be called from this context as it is declared protected in class AlgoWeb\ODataMetadata\Me...\cs\TScalarPropertyType.

This check looks for access to methods that are not accessible from the current context.

If you need to make a method accessible to another context you can raise its visibility level in the defining class.

Loading history...
158
            return false;
159
        }
160
        if (null != $this->complexProperty && !$this->complexProperty->isOK($msg)) {
161
            return false;
162
        }
163
        if (null != $this->condition && !$this->condition->isOK($msg)) {
164
            return false;
165
        }
166
        return true;
167
    }
168
}
169