<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

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