<?php

namespace patest\ArrayType;

use \WsdlToPhp\PackageBase\AbstractStructArrayBase;

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