<?php

namespace patest\ArrayType;

use \WsdlToPhp\PackageBase\AbstractStructArrayBase;

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