1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\Groups; |
4
|
|
|
|
5
|
|
|
use AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TModificationFunctionMappingAssociationEndType; |
6
|
|
|
use AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TModificationFunctionMappingComplexPropertyType; |
7
|
|
|
use AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TModificationFunctionMappingScalarPropertyType; |
8
|
|
|
|
9
|
|
|
trait TEntityTypeModificationFunctionMappingPropertyGroup |
10
|
|
|
{ |
11
|
|
|
/** |
12
|
|
|
* @property \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TModificationFunctionMappingScalarPropertyType |
13
|
|
|
* $scalarProperty |
14
|
|
|
*/ |
15
|
|
|
private $scalarProperty = null; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* @property \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TModificationFunctionMappingAssociationEndType |
19
|
|
|
* $associationEnd |
20
|
|
|
*/ |
21
|
|
|
private $associationEnd = null; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @property \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TModificationFunctionMappingComplexPropertyType |
25
|
|
|
* $complexProperty |
26
|
|
|
*/ |
27
|
|
|
private $complexProperty = null; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* Gets as scalarProperty |
31
|
|
|
* |
32
|
|
|
* @return \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TModificationFunctionMappingScalarPropertyType |
33
|
|
|
*/ |
34
|
|
|
public function getScalarProperty() |
35
|
|
|
{ |
36
|
|
|
return $this->scalarProperty; |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Sets a new scalarProperty |
41
|
|
|
* |
42
|
|
|
* @param \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TModificationFunctionMappingScalarPropertyType |
43
|
|
|
* $scalarProperty |
44
|
|
|
* @return self |
45
|
|
|
*/ |
46
|
|
|
public function setScalarProperty(TModificationFunctionMappingScalarPropertyType $scalarProperty) |
47
|
|
|
{ |
48
|
|
|
$this->scalarProperty = $scalarProperty; |
49
|
|
|
return $this; |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Gets as associationEnd |
54
|
|
|
* |
55
|
|
|
* @return \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TModificationFunctionMappingAssociationEndType |
56
|
|
|
*/ |
57
|
|
|
public function getAssociationEnd() |
58
|
|
|
{ |
59
|
|
|
return $this->associationEnd; |
60
|
|
|
} |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* Sets a new associationEnd |
64
|
|
|
* |
65
|
|
|
* @param \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TModificationFunctionMappingAssociationEndType |
66
|
|
|
* $associationEnd |
67
|
|
|
* @return self |
68
|
|
|
*/ |
69
|
|
|
public function setAssociationEnd(TModificationFunctionMappingAssociationEndType $associationEnd) |
70
|
|
|
{ |
71
|
|
|
$this->associationEnd = $associationEnd; |
72
|
|
|
return $this; |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* Gets as complexProperty |
77
|
|
|
* |
78
|
|
|
* @return \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TModificationFunctionMappingComplexPropertyType |
79
|
|
|
*/ |
80
|
|
|
public function getComplexProperty() |
81
|
|
|
{ |
82
|
|
|
return $this->complexProperty; |
83
|
|
|
} |
84
|
|
|
|
85
|
|
|
/** |
86
|
|
|
* Sets a new complexProperty |
87
|
|
|
* |
88
|
|
|
* @param \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TModificationFunctionMappingComplexPropertyType |
89
|
|
|
* $complexProperty |
90
|
|
|
* @return self |
91
|
|
|
*/ |
92
|
|
|
public function setComplexProperty(TModificationFunctionMappingComplexPropertyType $complexProperty) |
93
|
|
|
{ |
94
|
|
|
$this->complexProperty = $complexProperty; |
95
|
|
|
return $this; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
View Code Duplication |
public function isMappingPropertyGroupOK(&$msg = null) |
|
|
|
|
99
|
|
|
{ |
100
|
|
|
if (null != $this->scalarProperty && !$this->scalarProperty->isOK($msg)) { |
101
|
|
|
return false; |
102
|
|
|
} |
103
|
|
|
if (null != $this->complexProperty && !$this->complexProperty->isOK($msg)) { |
104
|
|
|
return false; |
105
|
|
|
} |
106
|
|
|
if (null != $this->associationEnd && !$this->associationEnd->isOK($msg)) { |
107
|
|
|
return false; |
108
|
|
|
} |
109
|
|
|
return true; |
110
|
|
|
} |
111
|
|
|
} |
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.