<?php

namespace patest\ArrayType;

use \WsdlToPhp\PackageBase\AbstractStructArrayBase;

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