xxxxxxxxxx
namespace GLS;
use \WsdlToPhp\PackageBase\AbstractStructArrayBase;
/**
* This class stands for cBulkCustomsClearanceAttachedFilesArray Array
* @subpackage Arrays
*/
class CBulkCustomsClearanceAttachedFilesArray extends AbstractStructArrayBase
{
/**
* The items
* Meta information extracted from the WSDL
* - maxOccurs: 3
* - minOccurs: 1
* @var \GLS\CBulkCustomsClearanceAttachedFile[]
*/
public $items;
/**
* Constructor method for cBulkCustomsClearanceAttachedFilesArray
* @uses CBulkCustomsClearanceAttachedFilesArray::setItems()
* @param \GLS\CBulkCustomsClearanceAttachedFile[] $items
*/
public function __construct(array $items = array())
{
$this
->setItems($items);
}
/**
* Get items value
* @return \GLS\CBulkCustomsClearanceAttachedFile[]
*/
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 $cBulkCustomsClearanceAttachedFilesArrayItemsItem) {
// validation for constraint: itemType
if (!$cBulkCustomsClearanceAttachedFilesArrayItemsItem instanceof \GLS\CBulkCustomsClearanceAttachedFile) {
$invalidValues[] = is_object($cBulkCustomsClearanceAttachedFilesArrayItemsItem) ? get_class($cBulkCustomsClearanceAttachedFilesArrayItemsItem) : sprintf('%s(%s)', gettype($cBulkCustomsClearanceAttachedFilesArrayItemsItem), var_export($cBulkCustomsClearanceAttachedFilesArrayItemsItem, true));
}
}
if (!empty($invalidValues)) {
$message = sprintf('The items property can only contain items of type \GLS\CBulkCustomsClearanceAttachedFile, %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 \GLS\CBulkCustomsClearanceAttachedFile[] $items
* @return \GLS\CBulkCustomsClearanceAttachedFilesArray
*/
public function setItems(array $items = array())
{
// validation for constraint: array
if ('' !== ($itemsArrayErrorMessage = self::validateItemsForArrayConstraintsFromSetItems($items))) {
throw new \InvalidArgumentException($itemsArrayErrorMessage, __LINE__);
}
// validation for constraint: maxOccurs(3)
if (is_array($items) && count($items) > 3) {
throw new \InvalidArgumentException(sprintf('Invalid count of %s, the number of elements contained by the property must be less than or equal to 3', count($items)), __LINE__);
}
$this->items = $items;
return $this;
}
/**
* Add item to items value
* @throws \InvalidArgumentException
* @param \GLS\CBulkCustomsClearanceAttachedFile $item
* @return \GLS\CBulkCustomsClearanceAttachedFilesArray
*/
public function addToItems(\GLS\CBulkCustomsClearanceAttachedFile $item)
{
// validation for constraint: itemType
if (!$item instanceof \GLS\CBulkCustomsClearanceAttachedFile) {
throw new \InvalidArgumentException(sprintf('The items property can only contain items of type \GLS\CBulkCustomsClearanceAttachedFile, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
}
// validation for constraint: maxOccurs(3)
if (is_array($this->items) && count($this->items) >= 3) {
throw new \InvalidArgumentException(sprintf('You can\'t add anymore element to this property that already contains %s elements, the number of elements contained by the property must be less than or equal to 3', count($this->items)), __LINE__);
}
$this->items[] = $item;
return $this;
}
/**
* Returns the current element
* @see AbstractStructArrayBase::current()
* @return \GLS\CBulkCustomsClearanceAttachedFile
*/
public function current()
{
return parent::current();
}
/**
* Returns the indexed element
* @see AbstractStructArrayBase::item()
* @param int $index
* @return \GLS\CBulkCustomsClearanceAttachedFile
*/
public function item($index)
{
return parent::item($index);
}
/**
* Returns the first element
* @see AbstractStructArrayBase::first()
* @return \GLS\CBulkCustomsClearanceAttachedFile
*/
public function first()
{
return parent::first();
}
/**
* Returns the last element
* @see AbstractStructArrayBase::last()
* @return \GLS\CBulkCustomsClearanceAttachedFile
*/
public function last()
{
return parent::last();
}
/**
* Returns the element at the offset
* @see AbstractStructArrayBase::offsetGet()
* @param int $offset
* @return \GLS\CBulkCustomsClearanceAttachedFile
*/
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