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

AssociationSetAnonymousType::setDocumentation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 5
Ratio 100 %

Importance

Changes 0
Metric Value
dl 5
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\EntityContainer;
4
5
use AlgoWeb\ODataMetadata\IsOK;
6
use AlgoWeb\ODataMetadata\MetadataV3\edm\EntityContainer\AssociationSetAnonymousType\EndAnonymousType;
7
use AlgoWeb\ODataMetadata\MetadataV3\edm\Groups\GEmptyElementExtensibilityTrait;
8
9
/**
10
 * Class representing AssociationSetAnonymousType
11
 */
12 View Code Duplication
class AssociationSetAnonymousType extends IsOK
0 ignored issues
show
Duplication introduced by
This class 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...
13
{
14
    use GEmptyElementExtensibilityTrait;
15
    /**
16
     * @property string $name
17
     */
18
    private $name = null;
19
20
    /**
21
     * @property string $association
22
     */
23
    private $association = null;
24
25
    /**
26
     * @property
27
     * \AlgoWeb\ODataMetadata\MetadataV3\edm\EntityContainer\AssociationSetAnonymousType\EndAnonymousType[]
28
     * $end
29
     */
30
    private $end = [];
31
32
    /**
33
     * Gets as name
34
     *
35
     * @return string
36
     */
37
    public function getName()
38
    {
39
        return $this->name;
40
    }
41
42
    /**
43
     * Sets a new name
44
     *
45
     * @param string $name
46
     * @return self
47
     */
48
    public function setName($name)
49
    {
50
        $this->name = $name;
51
        return $this;
52
    }
53
54
    /**
55
     * Gets as association
56
     *
57
     * @return string
58
     */
59
    public function getAssociation()
60
    {
61
        return $this->association;
62
    }
63
64
    /**
65
     * Sets a new association
66
     *
67
     * @param string $association
68
     * @return self
69
     */
70
    public function setAssociation($association)
71
    {
72
        $this->association = $association;
73
        return $this;
74
    }
75
76
    /**
77
     * Adds as end
78
     *
79
     * @return self
80
     * @param
81
     * \AlgoWeb\ODataMetadata\MetadataV3\edm\EntityContainer\AssociationSetAnonymousType\EndAnonymousType
82
     * $end
83
     */
84
    public function addToEnd(EndAnonymousType $end)
85
    {
86
        $this->end[] = $end;
87
        return $this;
88
    }
89
90
    /**
91
     * isset end
92
     *
93
     * @param scalar $index
94
     * @return boolean
95
     */
96
    public function issetEnd($index)
97
    {
98
        return isset($this->end[$index]);
99
    }
100
101
    /**
102
     * unset end
103
     *
104
     * @param scalar $index
105
     * @return void
106
     */
107
    public function unsetEnd($index)
108
    {
109
        unset($this->end[$index]);
110
    }
111
112
    /**
113
     * Gets as end
114
     *
115
     * @return
116
     * \AlgoWeb\ODataMetadata\MetadataV3\edm\EntityContainer\AssociationSetAnonymousType\EndAnonymousType[]
117
     */
118
    public function getEnd()
119
    {
120
        return $this->end;
121
    }
122
123
    /**
124
     * Sets a new end
125
     *
126
     * @param
127
     * \AlgoWeb\ODataMetadata\MetadataV3\edm\EntityContainer\AssociationSetAnonymousType\EndAnonymousType[]
128
     * $end
129
     * @return self
130
     */
131
    public function setEnd(array $end)
132
    {
133
        $this->end = $end;
134
        return $this;
135
    }
136
137
    public function isOK(&$msg = null)
138
    {
139
        if (!$this->isExtensibilityElementOK($msg)) {
140
            return false;
141
        }
142
        return true;
143
    }
144
}
145