<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for removeParameters StructType
 * @subpackage Structs
 */
class RemoveParameters extends XCommonMembersExtension
{
    /**
     * The parameter
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 1
     * @var XIpPhoneServicesParameter[]
     */
    public $parameter;
    /**
     * Constructor method for removeParameters
     * @uses RemoveParameters::setParameter()
     * @param XIpPhoneServicesParameter[] $parameter
     */
    public function __construct(array $parameter = array())
    {
        $this
            ->setParameter($parameter);
    }
    /**
     * Get parameter value
     * @return XIpPhoneServicesParameter[]
     */
    public function getParameter()
    {
        return $this->parameter;
    }
    /**
     * Set parameter value
     * @throws \InvalidArgumentException
     * @param XIpPhoneServicesParameter[] $parameter
     * @return RemoveParameters
     */
    public function setParameter(array $parameter = array())
    {
        foreach ($parameter as $removeParametersParameterItem) {
            // validation for constraint: itemType
            if (!$removeParametersParameterItem instanceof XIpPhoneServicesParameter) {
                throw new \InvalidArgumentException(sprintf('The parameter property can only contain items of XIpPhoneServicesParameter, "%s" given', is_object($removeParametersParameterItem) ? get_class($removeParametersParameterItem) : gettype($removeParametersParameterItem)), __LINE__);
            }
        }
        $this->parameter = $parameter;
        return $this;
    }
    /**
     * Add item to parameter value
     * @throws \InvalidArgumentException
     * @param XIpPhoneServicesParameter $item
     * @return RemoveParameters
     */
    public function addToParameter(XIpPhoneServicesParameter $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof XIpPhoneServicesParameter) {
            throw new \InvalidArgumentException(sprintf('The parameter property can only contain items of XIpPhoneServicesParameter, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->parameter[] = $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 RemoveParameters
     */
    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__;
    }
}
