xxxxxxxxxx
namespace GlsApi\Array;
use \WsdlToPhp\PackageBase\AbstractStructArrayBase;
/**
* This class stands for cParcelShop2DescArray Array
* @subpackage Arrays
*/
class CParcelShop2DescArray extends AbstractStructArrayBase
{
/**
* The items
* Meta information extracted from the WSDL
* - maxOccurs: unbounded
* - minOccurs: 1
* @var \GlsApi\Struct\CParcelShop2Desc[]
*/
public $items;
/**
* Constructor method for cParcelShop2DescArray
* @uses CParcelShop2DescArray::setItems()
* @param \GlsApi\Struct\CParcelShop2Desc[] $items
*/
public function __construct(array $items = array())
{
$this
->setItems($items);
}
/**
* Get items value
* @return \GlsApi\Struct\CParcelShop2Desc[]
*/
public function getItems()
{
return $this->items;
}
/**
* This method is responsible for validating the values passed to the setItems method
* This method is willingly generated in order to preserve the one-line inline validation within the setItems method
* @param array $values
* @return string A non-empty message if the values does not match the validation rules
*/
public static function validateItemsForArrayConstraintsFromSetItems(array $values = array())
{
$message = '';
$invalidValues = [];
foreach ($values as $cParcelShop2DescArrayItemsItem) {
// validation for constraint: itemType
if (!$cParcelShop2DescArrayItemsItem instanceof \GlsApi\Struct\CParcelShop2Desc) {
$invalidValues[] = is_object($cParcelShop2DescArrayItemsItem) ? get_class($cParcelShop2DescArrayItemsItem) : sprintf('%s(%s)', gettype($cParcelShop2DescArrayItemsItem), var_export($cParcelShop2DescArrayItemsItem, true));
}
}
if (!empty($invalidValues)) {
$message = sprintf('The items property can only contain items of type \GlsApi\Struct\CParcelShop2Desc, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
}
unset($invalidValues);
return $message;
}
/**
* Set items value
* @throws \InvalidArgumentException
* @param \GlsApi\Struct\CParcelShop2Desc[] $items
* @return \GlsApi\Array\CParcelShop2DescArray
*/
public function setItems(array $items = array())
{
// validation for constraint: array
if ('' !== ($itemsArrayErrorMessage = self::validateItemsForArrayConstraintsFromSetItems($items))) {
throw new \InvalidArgumentException($itemsArrayErrorMessage, __LINE__);
}
$this->items = $items;
return $this;
}
/**
* Add item to items value
* @throws \InvalidArgumentException
* @param \GlsApi\Struct\CParcelShop2Desc $item
* @return \GlsApi\Array\CParcelShop2DescArray
*/
public function addToItems(\GlsApi\Struct\CParcelShop2Desc $item)
{
// validation for constraint: itemType
if (!$item instanceof \GlsApi\Struct\CParcelShop2Desc) {
throw new \InvalidArgumentException(sprintf('The items property can only contain items of type \GlsApi\Struct\CParcelShop2Desc, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
}
$this->items[] = $item;
return $this;
}
/**
* Returns the current element
* @see AbstractStructArrayBase::current()
* @return \GlsApi\Struct\CParcelShop2Desc
*/
public function current()
{
return parent::current();
}
/**
* Returns the indexed element
* @see AbstractStructArrayBase::item()
* @param int $index
* @return \GlsApi\Struct\CParcelShop2Desc
*/
public function item($index)
{
return parent::item($index);
}
/**
* Returns the first element
* @see AbstractStructArrayBase::first()
* @return \GlsApi\Struct\CParcelShop2Desc
*/
public function first()
{
return parent::first();
}
/**
* Returns the last element
* @see AbstractStructArrayBase::last()
* @return \GlsApi\Struct\CParcelShop2Desc
*/
public function last()
{
return parent::last();
}
/**
* Returns the element at the offset
* @see AbstractStructArrayBase::offsetGet()
* @param int $offset
* @return \GlsApi\Struct\CParcelShop2Desc
*/
public function offsetGet($offset)
{
return parent::offsetGet($offset);
}
/**
* Returns the attribute name
* @see AbstractStructArrayBase::getAttributeName()
* @return string items
*/
public function getAttributeName()
{
return 'items';
}
}
Don't be shy, don't hesitate to contact us for any subject, we'll be glad to help.
This platform is provided to give developpers and non developpers a way to easily consume SOAP Web Services or share their own SOAP Web Services with extra features powered by the platform.
© 2025 Providr.IO