1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace AlgoWeb\ODataMetadata\MetadataV3\edm; |
4
|
|
|
|
5
|
|
|
use AlgoWeb\ODataMetadata\IsOK; |
6
|
|
|
use AlgoWeb\ODataMetadata\IsOKTraits\IsOKToolboxTrait; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Class representing TDocumentationType |
10
|
|
|
* |
11
|
|
|
* The Documentation element is used to provide documentation of comments on the |
12
|
|
|
* contents of the XML file. It is valid under Schema, Type, Index and Relationship |
13
|
|
|
* elements. |
14
|
|
|
* XSD Type: TDocumentation |
15
|
|
|
*/ |
16
|
|
View Code Duplication |
class TDocumentationType extends IsOK |
|
|
|
|
17
|
|
|
{ |
18
|
|
|
use IsOKToolboxTrait; |
19
|
|
|
/** |
20
|
|
|
* @property \AlgoWeb\ODataMetadata\MetadataV3\edm\TTextType $summary |
21
|
|
|
*/ |
22
|
|
|
private $summary = null; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @property \AlgoWeb\ODataMetadata\MetadataV3\edm\TTextType $longDescription |
26
|
|
|
*/ |
27
|
|
|
private $longDescription = null; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* Gets as summary |
31
|
|
|
* |
32
|
|
|
* @return \AlgoWeb\ODataMetadata\MetadataV3\edm\TTextType |
33
|
|
|
*/ |
34
|
|
|
public function getSummary() |
35
|
|
|
{ |
36
|
|
|
return $this->summary; |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* Sets a new summary |
41
|
|
|
* |
42
|
|
|
* @param \AlgoWeb\ODataMetadata\MetadataV3\edm\TTextType $summary |
43
|
|
|
* @return self |
44
|
|
|
*/ |
45
|
|
|
public function setSummary(TTextType $summary) |
46
|
|
|
{ |
47
|
|
|
$this->summary = $summary; |
48
|
|
|
return $this; |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* Gets as longDescription |
53
|
|
|
* |
54
|
|
|
* @return \AlgoWeb\ODataMetadata\MetadataV3\edm\TTextType |
55
|
|
|
*/ |
56
|
|
|
public function getLongDescription() |
57
|
|
|
{ |
58
|
|
|
return $this->longDescription; |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Sets a new longDescription |
63
|
|
|
* |
64
|
|
|
* @param \AlgoWeb\ODataMetadata\MetadataV3\edm\TTextType $longDescription |
65
|
|
|
* @return self |
66
|
|
|
*/ |
67
|
|
|
public function setLongDescription(TTextType $longDescription) |
68
|
|
|
{ |
69
|
|
|
$this->longDescription = $longDescription; |
70
|
|
|
return $this; |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
public function isOK(&$msg = null) |
74
|
|
|
{ |
75
|
|
|
if (!$this->isObjectNullOrOK($this->summary, $msg)) { |
76
|
|
|
return false; |
77
|
|
|
} |
78
|
|
|
if (!$this->isObjectNullOrOK($this->longDescription, $msg)) { |
79
|
|
|
return false; |
80
|
|
|
} |
81
|
|
|
return true; |
82
|
|
|
} |
83
|
|
|
} |
84
|
|
|
|
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.