<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

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