<?php

namespace patest\ArrayType;

use \WsdlToPhp\PackageBase\AbstractStructArrayBase;

/**
 * This class stands for ArrayOfKeyValueOfintSeatStatusInformationvEzo7Bse
 * ArrayType
 * Meta information extracted from the WSDL
 * - nillable: true
 * - type: tns:ArrayOfKeyValueOfintSeatStatusInformationvEzo7Bse
 * @subpackage Arrays
 */
class ArrayOfKeyValueOfintSeatStatusInformationvEzo7Bse extends AbstractStructArrayBase
{
    /**
     * The KeyValueOfintSeatStatusInformationvEzo7Bse
     * Meta information extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \patest\StructType\KeyValueOfintSeatStatusInformationvEzo7Bse[]
     */
    public $KeyValueOfintSeatStatusInformationvEzo7Bse;
    /**
     * Constructor method for ArrayOfKeyValueOfintSeatStatusInformationvEzo7Bse
     * @uses ArrayOfKeyValueOfintSeatStatusInformationvEzo7Bse::setKeyValueOfintSeatStatusInformationvEzo7Bse()
     * @param \patest\StructType\KeyValueOfintSeatStatusInformationvEzo7Bse[] $keyValueOfintSeatStatusInformationvEzo7Bse
     */
    public function __construct(array $keyValueOfintSeatStatusInformationvEzo7Bse = array())
    {
        $this
            ->setKeyValueOfintSeatStatusInformationvEzo7Bse($keyValueOfintSeatStatusInformationvEzo7Bse);
    }
    /**
     * Get KeyValueOfintSeatStatusInformationvEzo7Bse value
     * @return \patest\StructType\KeyValueOfintSeatStatusInformationvEzo7Bse[]|null
     */
    public function getKeyValueOfintSeatStatusInformationvEzo7Bse()
    {
        return $this->KeyValueOfintSeatStatusInformationvEzo7Bse;
    }
    /**
     * This method is responsible for validating the values passed to the setKeyValueOfintSeatStatusInformationvEzo7Bse method
     * This method is willingly generated in order to preserve the one-line inline validation within the setKeyValueOfintSeatStatusInformationvEzo7Bse method
     * @param array $values
     * @return string A non-empty message if the values does not match the validation rules
     */
    public static function validateKeyValueOfintSeatStatusInformationvEzo7BseForArrayConstraintsFromSetKeyValueOfintSeatStatusInformationvEzo7Bse(array $values = array())
    {
        $message = '';
        $invalidValues = [];
        foreach ($values as $arrayOfKeyValueOfintSeatStatusInformationvEzo7BseKeyValueOfintSeatStatusInformationvEzo7BseItem) {
            // validation for constraint: itemType
            if (!$arrayOfKeyValueOfintSeatStatusInformationvEzo7BseKeyValueOfintSeatStatusInformationvEzo7BseItem instanceof \patest\StructType\KeyValueOfintSeatStatusInformationvEzo7Bse) {
                $invalidValues[] = is_object($arrayOfKeyValueOfintSeatStatusInformationvEzo7BseKeyValueOfintSeatStatusInformationvEzo7BseItem) ? get_class($arrayOfKeyValueOfintSeatStatusInformationvEzo7BseKeyValueOfintSeatStatusInformationvEzo7BseItem) : sprintf('%s(%s)', gettype($arrayOfKeyValueOfintSeatStatusInformationvEzo7BseKeyValueOfintSeatStatusInformationvEzo7BseItem), var_export($arrayOfKeyValueOfintSeatStatusInformationvEzo7BseKeyValueOfintSeatStatusInformationvEzo7BseItem, true));
            }
        }
        if (!empty($invalidValues)) {
            $message = sprintf('The KeyValueOfintSeatStatusInformationvEzo7Bse property can only contain items of type \patest\StructType\KeyValueOfintSeatStatusInformationvEzo7Bse, %s given', is_object($invalidValues) ? get_class($invalidValues) : (is_array($invalidValues) ? implode(', ', $invalidValues) : gettype($invalidValues)));
        }
        unset($invalidValues);
        return $message;
    }
    /**
     * Set KeyValueOfintSeatStatusInformationvEzo7Bse value
     * @throws \InvalidArgumentException
     * @param \patest\StructType\KeyValueOfintSeatStatusInformationvEzo7Bse[] $keyValueOfintSeatStatusInformationvEzo7Bse
     * @return \patest\ArrayType\ArrayOfKeyValueOfintSeatStatusInformationvEzo7Bse
     */
    public function setKeyValueOfintSeatStatusInformationvEzo7Bse(array $keyValueOfintSeatStatusInformationvEzo7Bse = array())
    {
        // validation for constraint: array
        if ('' !== ($keyValueOfintSeatStatusInformationvEzo7BseArrayErrorMessage = self::validateKeyValueOfintSeatStatusInformationvEzo7BseForArrayConstraintsFromSetKeyValueOfintSeatStatusInformationvEzo7Bse($keyValueOfintSeatStatusInformationvEzo7Bse))) {
            throw new \InvalidArgumentException($keyValueOfintSeatStatusInformationvEzo7BseArrayErrorMessage, __LINE__);
        }
        $this->KeyValueOfintSeatStatusInformationvEzo7Bse = $keyValueOfintSeatStatusInformationvEzo7Bse;
        return $this;
    }
    /**
     * Add item to KeyValueOfintSeatStatusInformationvEzo7Bse value
     * @throws \InvalidArgumentException
     * @param \patest\StructType\KeyValueOfintSeatStatusInformationvEzo7Bse $item
     * @return \patest\ArrayType\ArrayOfKeyValueOfintSeatStatusInformationvEzo7Bse
     */
    public function addToKeyValueOfintSeatStatusInformationvEzo7Bse(\patest\StructType\KeyValueOfintSeatStatusInformationvEzo7Bse $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \patest\StructType\KeyValueOfintSeatStatusInformationvEzo7Bse) {
            throw new \InvalidArgumentException(sprintf('The KeyValueOfintSeatStatusInformationvEzo7Bse property can only contain items of type \patest\StructType\KeyValueOfintSeatStatusInformationvEzo7Bse, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);
        }
        $this->KeyValueOfintSeatStatusInformationvEzo7Bse[] = $item;
        return $this;
    }
    /**
     * Returns the current element
     * @see AbstractStructArrayBase::current()
     * @return \patest\StructType\KeyValueOfintSeatStatusInformationvEzo7Bse|null
     */
    public function current()
    {
        return parent::current();
    }
    /**
     * Returns the indexed element
     * @see AbstractStructArrayBase::item()
     * @param int $index
     * @return \patest\StructType\KeyValueOfintSeatStatusInformationvEzo7Bse|null
     */
    public function item($index)
    {
        return parent::item($index);
    }
    /**
     * Returns the first element
     * @see AbstractStructArrayBase::first()
     * @return \patest\StructType\KeyValueOfintSeatStatusInformationvEzo7Bse|null
     */
    public function first()
    {
        return parent::first();
    }
    /**
     * Returns the last element
     * @see AbstractStructArrayBase::last()
     * @return \patest\StructType\KeyValueOfintSeatStatusInformationvEzo7Bse|null
     */
    public function last()
    {
        return parent::last();
    }
    /**
     * Returns the element at the offset
     * @see AbstractStructArrayBase::offsetGet()
     * @param int $offset
     * @return \patest\StructType\KeyValueOfintSeatStatusInformationvEzo7Bse|null
     */
    public function offsetGet($offset)
    {
        return parent::offsetGet($offset);
    }
    /**
     * Returns the attribute name
     * @see AbstractStructArrayBase::getAttributeName()
     * @return string KeyValueOfintSeatStatusInformationvEzo7Bse
     */
    public function getAttributeName()
    {
        return 'KeyValueOfintSeatStatusInformationvEzo7Bse';
    }
}
