<?php

namespace patest\ArrayType;

use \WsdlToPhp\PackageBase\AbstractStructArrayBase;

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