1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Ovh\ArrayType; |
4
|
|
|
|
5
|
|
|
use \WsdlToPhp\PackageBase\AbstractStructArrayBase; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* This class stands for MyArrayOfTelephonyConferenceParticipantStructType |
9
|
|
|
* ArrayType |
10
|
|
|
* @subpackage Arrays |
11
|
|
|
* @author WsdlToPhp <[email protected]> |
12
|
|
|
*/ |
13
|
|
|
class MyArrayOfTelephonyConferenceParticipantStructType extends AbstractStructArrayBase |
14
|
|
|
{ |
15
|
|
|
/** |
16
|
|
|
* The item |
17
|
|
|
* Meta information extracted from the WSDL |
18
|
|
|
* - maxOccurs: unbounded |
19
|
|
|
* - minOccurs: 0 |
20
|
|
|
* @var \Ovh\StructType\TelephonyConferenceParticipantStruct[] |
21
|
|
|
*/ |
22
|
|
|
public $item; |
23
|
|
|
/** |
24
|
|
|
* Constructor method for MyArrayOfTelephonyConferenceParticipantStructType |
25
|
|
|
* @uses MyArrayOfTelephonyConferenceParticipantStructType::setItem() |
26
|
|
|
* @param \Ovh\StructType\TelephonyConferenceParticipantStruct[] $item |
27
|
|
|
*/ |
28
|
|
|
public function __construct(array $item = array()) |
29
|
|
|
{ |
30
|
|
|
$this |
31
|
|
|
->setItem($item); |
32
|
|
|
} |
33
|
|
|
/** |
34
|
|
|
* Get item value |
35
|
|
|
* @return \Ovh\StructType\TelephonyConferenceParticipantStruct[]|null |
36
|
|
|
*/ |
37
|
|
|
public function getItem() |
38
|
|
|
{ |
39
|
|
|
return $this->item; |
40
|
|
|
} |
41
|
|
|
/** |
42
|
|
|
* This method is responsible for validating the values passed to the setItem method |
43
|
|
|
* This method is willingly generated in order to preserve the one-line inline validation within the setItem method |
44
|
|
|
* @param array $values |
45
|
|
|
* @return string A non-empty message if the values does not match the validation rules |
46
|
|
|
*/ |
47
|
|
|
public static function validateItemForArrayConstraintsFromSetItem(array $values = array()) |
48
|
|
|
{ |
49
|
|
|
$message = ''; |
50
|
|
|
$invalidValues = []; |
51
|
|
|
foreach ($values as $myArrayOfTelephonyConferenceParticipantStructTypeItemItem) { |
52
|
|
|
// validation for constraint: itemType |
53
|
|
|
if (!$myArrayOfTelephonyConferenceParticipantStructTypeItemItem instanceof \Ovh\StructType\TelephonyConferenceParticipantStruct) { |
54
|
|
|
$invalidValues[] = is_object($myArrayOfTelephonyConferenceParticipantStructTypeItemItem) ? get_class($myArrayOfTelephonyConferenceParticipantStructTypeItemItem) : sprintf('%s(%s)', gettype($myArrayOfTelephonyConferenceParticipantStructTypeItemItem), var_export($myArrayOfTelephonyConferenceParticipantStructTypeItemItem, true)); |
55
|
|
|
} |
56
|
|
|
} |
57
|
|
|
if (!empty($invalidValues)) { |
58
|
|
|
$message = sprintf('The item property can only contain items of type \Ovh\StructType\TelephonyConferenceParticipantStruct, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues))); |
|
|
|
|
59
|
|
|
} |
60
|
|
|
unset($invalidValues); |
61
|
|
|
return $message; |
62
|
|
|
} |
63
|
|
|
/** |
64
|
|
|
* Set item value |
65
|
|
|
* @throws \InvalidArgumentException |
66
|
|
|
* @param \Ovh\StructType\TelephonyConferenceParticipantStruct[] $item |
67
|
|
|
* @return \Ovh\ArrayType\MyArrayOfTelephonyConferenceParticipantStructType |
68
|
|
|
*/ |
69
|
|
|
public function setItem(array $item = array()) |
70
|
|
|
{ |
71
|
|
|
// validation for constraint: array |
72
|
|
|
if ('' !== ($itemArrayErrorMessage = self::validateItemForArrayConstraintsFromSetItem($item))) { |
73
|
|
|
throw new \InvalidArgumentException($itemArrayErrorMessage, __LINE__); |
74
|
|
|
} |
75
|
|
|
$this->item = $item; |
76
|
|
|
return $this; |
77
|
|
|
} |
78
|
|
|
/** |
79
|
|
|
* Add item to item value |
80
|
|
|
* @throws \InvalidArgumentException |
81
|
|
|
* @param \Ovh\StructType\TelephonyConferenceParticipantStruct $item |
82
|
|
|
* @return \Ovh\ArrayType\MyArrayOfTelephonyConferenceParticipantStructType |
83
|
|
|
*/ |
84
|
|
|
public function addToItem(\Ovh\StructType\TelephonyConferenceParticipantStruct $item) |
85
|
|
|
{ |
86
|
|
|
// validation for constraint: itemType |
87
|
|
|
if (!$item instanceof \Ovh\StructType\TelephonyConferenceParticipantStruct) { |
|
|
|
|
88
|
|
|
throw new \InvalidArgumentException(sprintf('The item property can only contain items of type \Ovh\StructType\TelephonyConferenceParticipantStruct, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__); |
89
|
|
|
} |
90
|
|
|
$this->item[] = $item; |
91
|
|
|
return $this; |
92
|
|
|
} |
93
|
|
|
/** |
94
|
|
|
* Returns the current element |
95
|
|
|
* @see AbstractStructArrayBase::current() |
96
|
|
|
* @return \Ovh\StructType\TelephonyConferenceParticipantStruct|null |
97
|
|
|
*/ |
98
|
|
|
public function current() |
99
|
|
|
{ |
100
|
|
|
return parent::current(); |
101
|
|
|
} |
102
|
|
|
/** |
103
|
|
|
* Returns the indexed element |
104
|
|
|
* @see AbstractStructArrayBase::item() |
105
|
|
|
* @param int $index |
106
|
|
|
* @return \Ovh\StructType\TelephonyConferenceParticipantStruct|null |
107
|
|
|
*/ |
108
|
|
|
public function item($index) |
109
|
|
|
{ |
110
|
|
|
return parent::item($index); |
111
|
|
|
} |
112
|
|
|
/** |
113
|
|
|
* Returns the first element |
114
|
|
|
* @see AbstractStructArrayBase::first() |
115
|
|
|
* @return \Ovh\StructType\TelephonyConferenceParticipantStruct|null |
116
|
|
|
*/ |
117
|
|
|
public function first() |
118
|
|
|
{ |
119
|
|
|
return parent::first(); |
120
|
|
|
} |
121
|
|
|
/** |
122
|
|
|
* Returns the last element |
123
|
|
|
* @see AbstractStructArrayBase::last() |
124
|
|
|
* @return \Ovh\StructType\TelephonyConferenceParticipantStruct|null |
125
|
|
|
*/ |
126
|
|
|
public function last() |
127
|
|
|
{ |
128
|
|
|
return parent::last(); |
129
|
|
|
} |
130
|
|
|
/** |
131
|
|
|
* Returns the element at the offset |
132
|
|
|
* @see AbstractStructArrayBase::offsetGet() |
133
|
|
|
* @param int $offset |
134
|
|
|
* @return \Ovh\StructType\TelephonyConferenceParticipantStruct|null |
135
|
|
|
*/ |
136
|
|
|
public function offsetGet($offset) |
137
|
|
|
{ |
138
|
|
|
return parent::offsetGet($offset); |
139
|
|
|
} |
140
|
|
|
/** |
141
|
|
|
* Returns the attribute name |
142
|
|
|
* @see AbstractStructArrayBase::getAttributeName() |
143
|
|
|
* @return string item |
144
|
|
|
*/ |
145
|
|
|
public function getAttributeName() |
146
|
|
|
{ |
147
|
|
|
return 'item'; |
148
|
|
|
} |
149
|
|
|
} |
150
|
|
|
|