1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace AlgoWeb\ODataMetadata\MetadataV3\edmx; |
4
|
|
|
|
5
|
|
|
use AlgoWeb\ODataMetadata\IsOK; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Class representing TOptionsType |
9
|
|
|
* |
10
|
|
|
* |
11
|
|
|
* XSD Type: TOptions |
12
|
|
|
*/ |
13
|
|
View Code Duplication |
class TOptionsType extends IsOK |
|
|
|
|
14
|
|
|
{ |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* @property \AlgoWeb\ODataMetadata\MetadataV3\edmx\TDesignerPropertyType[] $designerInfoPropertySet |
18
|
|
|
*/ |
19
|
|
|
private $designerInfoPropertySet = []; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Adds as designerProperty |
23
|
|
|
* |
24
|
|
|
* @return self |
25
|
|
|
* @param \AlgoWeb\ODataMetadata\MetadataV3\edmx\TDesignerPropertyType $designerProperty |
26
|
|
|
*/ |
27
|
|
|
public function addToDesignerInfoPropertySet(TDesignerPropertyType $designerProperty) |
28
|
|
|
{ |
29
|
|
|
$this->designerInfoPropertySet[] = $designerProperty; |
30
|
|
|
return $this; |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* isset designerInfoPropertySet |
35
|
|
|
* |
36
|
|
|
* @param scalar $index |
37
|
|
|
* @return boolean |
38
|
|
|
*/ |
39
|
|
|
public function issetDesignerInfoPropertySet($index) |
40
|
|
|
{ |
41
|
|
|
return isset($this->designerInfoPropertySet[$index]); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* unset designerInfoPropertySet |
46
|
|
|
* |
47
|
|
|
* @param scalar $index |
48
|
|
|
* @return void |
49
|
|
|
*/ |
50
|
|
|
public function unsetDesignerInfoPropertySet($index) |
51
|
|
|
{ |
52
|
|
|
unset($this->designerInfoPropertySet[$index]); |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* Gets as designerInfoPropertySet |
57
|
|
|
* |
58
|
|
|
* @return \AlgoWeb\ODataMetadata\MetadataV3\edmx\TDesignerPropertyType[] |
59
|
|
|
*/ |
60
|
|
|
public function getDesignerInfoPropertySet() |
61
|
|
|
{ |
62
|
|
|
return $this->designerInfoPropertySet; |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* Sets a new designerInfoPropertySet |
67
|
|
|
* |
68
|
|
|
* @param \AlgoWeb\ODataMetadata\MetadataV3\edmx\TDesignerPropertyType[] $designerInfoPropertySet |
69
|
|
|
* @return self |
70
|
|
|
*/ |
71
|
|
|
public function setDesignerInfoPropertySet(array $designerInfoPropertySet) |
72
|
|
|
{ |
73
|
|
|
$this->designerInfoPropertySet = $designerInfoPropertySet; |
74
|
|
|
return $this; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
public function isOK(&$msg = null) |
78
|
|
|
{ |
79
|
|
|
if (!$this->isValidArray( |
80
|
|
|
$this->designerInfoPropertySet, |
81
|
|
|
'\AlgoWeb\ODataMetadata\MetadataV3\edmx\TDesignerPropertyType' |
82
|
|
|
)) { |
83
|
|
|
$msg = "Designer info property set not a valid array"; |
84
|
|
|
return false; |
85
|
|
|
} |
86
|
|
|
if (!$this->isChildArrayOK($this->designerInfoPropertySet, $msg)) { |
87
|
|
|
return false; |
88
|
|
|
} |
89
|
|
|
} |
90
|
|
|
} |
91
|
|
|
|
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.