Passed
Push — master ( 189420...0898fe )
by Alex
04:14
created

TEnumTypeType::isOK()   B

Complexity

Conditions 6
Paths 6

Size

Total Lines 26
Code Lines 17

Duplication

Lines 26
Ratio 100 %

Importance

Changes 0
Metric Value
dl 26
loc 26
rs 8.439
c 0
b 0
f 0
cc 6
eloc 17
nc 6
nop 1
1
<?php
2
3
namespace AlgoWeb\ODataMetadata\MetadataV3\edm;
4
5
use AlgoWeb\ODataMetadata\CodeGeneration\AccessTypeTraits;
6
use AlgoWeb\ODataMetadata\IsOK;
7
use AlgoWeb\ODataMetadata\IsOKTraits\IsOKToolboxTrait;
8
use AlgoWeb\ODataMetadata\MetadataV3\edm\Groups\TTypeAttributesTrait;
9
use AlgoWeb\ODataMetadata\MetadataV3\edm\IsOKTraits\TPropertyTypeTrait;
10
11
/**
12
 * Class representing TEnumTypeType
13
 *
14
 *
15
 * XSD Type: TEnumType
16
 */
17
class TEnumTypeType extends IsOK
18
{
19
    use IsOKToolboxTrait, TTypeAttributesTrait, TPropertyTypeTrait, AccessTypeTraits;
20
21
    /**
22
     * @property boolean $isFlags
23
     */
24
    private $isFlags = null;
25
26
    /**
27
     * @property string $underlyingType
28
     */
29
    private $underlyingType = null;
30
31
    /**
32
     * @property string $typeAccess
33
     */
34
    private $typeAccess = null;
35
36
    /**
37
     * @property \AlgoWeb\ODataMetadata\MetadataV3\edm\TDocumentationType $documentation
38
     */
39
    private $documentation = null;
40
41
    /**
42
     * @property \AlgoWeb\ODataMetadata\MetadataV3\edm\TEnumTypeMemberType[] $member
43
     */
44
    private $member = [];
45
46
    /**
47
     * Gets as isFlags
48
     *
49
     * @return boolean
50
     */
51
    public function getIsFlags()
52
    {
53
        return $this->isFlags;
54
    }
55
56
    /**
57
     * Sets a new isFlags
58
     *
59
     * @param boolean $isFlags
60
     * @return self
61
     */
62
    public function setIsFlags($isFlags)
63
    {
64
        $this->isFlags = $isFlags;
65
        return $this;
66
    }
67
68
    /**
69
     * Gets as underlyingType
70
     *
71
     * @return string
72
     */
73
    public function getUnderlyingType()
74
    {
75
        return $this->underlyingType;
76
    }
77
78
    /**
79
     * Sets a new underlyingType
80
     *
81
     * @param string $underlyingType
82
     * @return self
83
     */
84
    public function setUnderlyingType($underlyingType)
85
    {
86
        $this->underlyingType = $underlyingType;
87
        return $this;
88
    }
89
90
    /**
91
     * Gets as typeAccess
92
     *
93
     * @return string
94
     */
95
    public function getTypeAccess()
96
    {
97
        return $this->typeAccess;
98
    }
99
100
    /**
101
     * Sets a new typeAccess
102
     *
103
     * @param string $typeAccess
104
     * @return self
105
     */
106
    public function setTypeAccess($typeAccess)
107
    {
108
        $this->typeAccess = $typeAccess;
109
        return $this;
110
    }
111
112
    /**
113
     * Gets as documentation
114
     *
115
     * @return \AlgoWeb\ODataMetadata\MetadataV3\edm\TDocumentationType
116
     */
117
    public function getDocumentation()
118
    {
119
        return $this->documentation;
120
    }
121
122
    /**
123
     * Sets a new documentation
124
     *
125
     * @param \AlgoWeb\ODataMetadata\MetadataV3\edm\TDocumentationType $documentation
126
     * @return self
127
     */
128
    public function setDocumentation(TDocumentationType $documentation)
129
    {
130
        $this->documentation = $documentation;
131
        return $this;
132
    }
133
134
    /**
135
     * Adds as member
136
     *
137
     * @return self
138
     * @param \AlgoWeb\ODataMetadata\MetadataV3\edm\TEnumTypeMemberType $member
139
     */
140
    public function addToMember(TEnumTypeMemberType $member)
141
    {
142
        $this->member[] = $member;
143
        return $this;
144
    }
145
146
    /**
147
     * isset member
148
     *
149
     * @param scalar $index
150
     * @return boolean
151
     */
152
    public function issetMember($index)
153
    {
154
        return isset($this->member[$index]);
155
    }
156
157
    /**
158
     * unset member
159
     *
160
     * @param scalar $index
161
     * @return void
162
     */
163
    public function unsetMember($index)
164
    {
165
        unset($this->member[$index]);
166
    }
167
168
    /**
169
     * Gets as member
170
     *
171
     * @return \AlgoWeb\ODataMetadata\MetadataV3\edm\TEnumTypeMemberType[]
172
     */
173
    public function getMember()
174
    {
175
        return $this->member;
176
    }
177
178
    /**
179
     * Sets a new member
180
     *
181
     * @param \AlgoWeb\ODataMetadata\MetadataV3\edm\TEnumTypeMemberType[] $member
182
     * @return self
183
     */
184
    public function setMember(array $member)
185
    {
186
        $this->member = $member;
187
        return $this;
188
    }
189
190 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...
191
    {
192
        if (!$this->isTPropertyTypeValid($this->underlyingType)) {
193
            $msg = "Underlying type must be a valid TPropertyType";
194
            return false;
195
        }
196
        if (!$this->isTPublicOrInternalAccessOK($this->typeAccess)) {
197
            $msg = "Type access must be Public or Internal";
198
            return false;
199
        }
200
        if (!$this->isObjectNullOrOK($this->documentation, $msg)) {
201
            return false;
202
        }
203
        if (!$this->isValidArrayOK(
204
            $this->member,
205
            '\AlgoWeb\ODataMetadata\MetadataV3\edm\TEnumTypeMemberType',
206
            $msg
207
        )) {
208
            return false;
209
        }
210
211
        if (!$this->isTTypeAttributesValid($msg)) {
212
            return false;
213
        }
214
        return true;
215
    }
216
}
217