<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for removeCallStates StructType
 * @subpackage Structs
 */
class RemoveCallStates extends AbstractStructBase
{
    /**
     * The callState
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * @var XCallStateMember[]
     */
    public $callState;
    /**
     * Constructor method for removeCallStates
     * @uses RemoveCallStates::setCallState()
     * @param XCallStateMember[] $callState
     */
    public function __construct(array $callState = array())
    {
        $this
            ->setCallState($callState);
    }
    /**
     * Get callState value
     * @return XCallStateMember[]|null
     */
    public function getCallState()
    {
        return $this->callState;
    }
    /**
     * Set callState value
     * @throws \InvalidArgumentException
     * @param XCallStateMember[] $callState
     * @return RemoveCallStates
     */
    public function setCallState(array $callState = array())
    {
        foreach ($callState as $removeCallStatesCallStateItem) {
            // validation for constraint: itemType
            if (!$removeCallStatesCallStateItem instanceof XCallStateMember) {
                throw new \InvalidArgumentException(sprintf('The callState property can only contain items of XCallStateMember, "%s" given', is_object($removeCallStatesCallStateItem) ? get_class($removeCallStatesCallStateItem) : gettype($removeCallStatesCallStateItem)), __LINE__);
            }
        }
        $this->callState = $callState;
        return $this;
    }
    /**
     * Add item to callState value
     * @throws \InvalidArgumentException
     * @param XCallStateMember $item
     * @return RemoveCallStates
     */
    public function addToCallState(XCallStateMember $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof XCallStateMember) {
            throw new \InvalidArgumentException(sprintf('The callState property can only contain items of XCallStateMember, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->callState[] = $item;
        return $this;
    }
    /**
     * Method called when an object has been exported with var_export() functions
     * It allows to return an object instantiated with the values
     * @see AbstractStructBase::__set_state()
     * @uses AbstractStructBase::__set_state()
     * @param array $array the exported values
     * @return RemoveCallStates
     */
    public static function __set_state(array $array)
    {
        return parent::__set_state($array);
    }
    /**
     * Method returning the class name
     * @return string __CLASS__
     */
    public function __toString()
    {
        return __CLASS__;
    }
}
