<?php

namespace patest\ArrayType;

use \WsdlToPhp\PackageBase\AbstractStructArrayBase;

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