<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

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