<?php

namespace patest\ArrayType;

use \WsdlToPhp\PackageBase\AbstractStructArrayBase;

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