Passed
Push — master ( feaee9...2b3e4e )
by Alex
04:28
created

TFunctionType::addToDefiningExpression()   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\edm;
4
5
use AlgoWeb\ODataMetadata\IsOK;
6
use AlgoWeb\ODataMetadata\MetadataV3\edm\Groups\TFacetAttributesTrait;
7
8
/**
9
 * Class representing TFunctionType
10
 *
11
 *
12
 * XSD Type: TFunction
13
 */
14
class TFunctionType extends IsOK
15
{
16
    use TFacetAttributesTrait;
17
    /**
18
     * @property string $name
19
     */
20
    private $name = null;
21
22
    /**
23
     * @property \AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionReturnTypeType[] $returnType
24
     */
25
    private $returnType = [];
26
27
    /**
28
     * @property \AlgoWeb\ODataMetadata\MetadataV3\edm\TDocumentationType $documentation
29
     */
30
    private $documentation = null;
31
32
    /**
33
     * @property \AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionParameterType[] $parameter
34
     */
35
    private $parameter = [];
36
37
    /**
38
     * @property string[] $definingExpression
39
     */
40
    private $definingExpression = [];
41
42
    /**
43
     * Gets as name
44
     *
45
     * @return string
46
     */
47
    public function getName()
48
    {
49
        return $this->name;
50
    }
51
52
    /**
53
     * Sets a new name
54
     *
55
     * @param string $name
56
     * @return self
57
     */
58
    public function setName($name)
59
    {
60
        $this->name = $name;
61
        return $this;
62
    }
63
64
    /**
65
     * Adds as returnType
66
     *
67
     * @return self
68
     * @param \AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionReturnTypeType $returnType
69
     */
70
    public function addToReturnType(TFunctionReturnTypeType $returnType)
71
    {
72
        $this->returnType[] = $returnType;
73
        return $this;
74
    }
75
76
    /**
77
     * isset returnType
78
     *
79
     * @param scalar $index
80
     * @return boolean
81
     */
82
    public function issetReturnType($index)
83
    {
84
        return isset($this->returnType[$index]);
85
    }
86
87
    /**
88
     * unset returnType
89
     *
90
     * @param scalar $index
91
     * @return void
92
     */
93
    public function unsetReturnType($index)
94
    {
95
        unset($this->returnType[$index]);
96
    }
97
98
    /**
99
     * Gets as returnType
100
     *
101
     * @return \AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionReturnTypeType[]
102
     */
103
    public function getReturnType()
104
    {
105
        return $this->returnType;
106
    }
107
108
    /**
109
     * Sets a new returnType
110
     *
111
     * @param \AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionReturnTypeType[] $returnType
112
     * @return self
113
     */
114
    public function setReturnType(array $returnType)
115
    {
116
        $this->returnType = $returnType;
117
        return $this;
118
    }
119
120
    /**
121
     * Gets as documentation
122
     *
123
     * @return \AlgoWeb\ODataMetadata\MetadataV3\edm\TDocumentationType
124
     */
125
    public function getDocumentation()
126
    {
127
        return $this->documentation;
128
    }
129
130
    /**
131
     * Sets a new documentation
132
     *
133
     * @param \AlgoWeb\ODataMetadata\MetadataV3\edm\TDocumentationType $documentation
134
     * @return self
135
     */
136
    public function setDocumentation(TDocumentationType $documentation)
137
    {
138
        $this->documentation = $documentation;
139
        return $this;
140
    }
141
142
    /**
143
     * Adds as parameter
144
     *
145
     * @return self
146
     * @param \AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionParameterType $parameter
147
     */
148
    public function addToParameter(TFunctionParameterType $parameter)
149
    {
150
        $this->parameter[] = $parameter;
151
        return $this;
152
    }
153
154
    /**
155
     * isset parameter
156
     *
157
     * @param scalar $index
158
     * @return boolean
159
     */
160
    public function issetParameter($index)
161
    {
162
        return isset($this->parameter[$index]);
163
    }
164
165
    /**
166
     * unset parameter
167
     *
168
     * @param scalar $index
169
     * @return void
170
     */
171
    public function unsetParameter($index)
172
    {
173
        unset($this->parameter[$index]);
174
    }
175
176
    /**
177
     * Gets as parameter
178
     *
179
     * @return \AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionParameterType[]
180
     */
181
    public function getParameter()
182
    {
183
        return $this->parameter;
184
    }
185
186
    /**
187
     * Sets a new parameter
188
     *
189
     * @param \AlgoWeb\ODataMetadata\MetadataV3\edm\TFunctionParameterType[] $parameter
190
     * @return self
191
     */
192
    public function setParameter(array $parameter)
193
    {
194
        $this->parameter = $parameter;
195
        return $this;
196
    }
197
198
    /**
199
     * Adds as definingExpression
200
     *
201
     * @return self
202
     * @param string $definingExpression
203
     */
204
    public function addToDefiningExpression($definingExpression)
205
    {
206
        $this->definingExpression[] = $definingExpression;
207
        return $this;
208
    }
209
210
    /**
211
     * isset definingExpression
212
     *
213
     * @param scalar $index
214
     * @return boolean
215
     */
216
    public function issetDefiningExpression($index)
217
    {
218
        return isset($this->definingExpression[$index]);
219
    }
220
221
    /**
222
     * unset definingExpression
223
     *
224
     * @param scalar $index
225
     * @return void
226
     */
227
    public function unsetDefiningExpression($index)
228
    {
229
        unset($this->definingExpression[$index]);
230
    }
231
232
    /**
233
     * Gets as definingExpression
234
     *
235
     * @return string[]
236
     */
237
    public function getDefiningExpression()
238
    {
239
        return $this->definingExpression;
240
    }
241
242
    /**
243
     * Sets a new definingExpression
244
     *
245
     * @param string $definingExpression
246
     * @return self
247
     */
248
    public function setDefiningExpression(array $definingExpression)
249
    {
250
        $this->definingExpression = $definingExpression;
251
        return $this;
252
    }
253
254
    public function isOK(&$msg = null)
255
    {
256
        if (!$this->isTFacetAttributesTraitValid($msg)) {
257
            return false;
258
        }
259
        return true;
260
    }
261
}
262