<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for directoryURIs StructType
 * Meta informations extracted from the WSDL
 * - documentation: While updating, send all the URIs | While updating, send all the URIs | While updating, send all the URIs | While updating, send all the URIs | While updating, send all the URIs
 * @subpackage Structs
 */
class DirectoryURIs extends AbstractStructBase
{
    /**
     * The directoryUri
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var XDirectoryUri[]
     */
    public $directoryUri;
    /**
     * Constructor method for directoryURIs
     * @uses DirectoryURIs::setDirectoryUri()
     * @param XDirectoryUri[] $directoryUri
     */
    public function __construct(array $directoryUri = array())
    {
        $this
            ->setDirectoryUri($directoryUri);
    }
    /**
     * Get directoryUri value
     * @return XDirectoryUri[]|null
     */
    public function getDirectoryUri()
    {
        return $this->directoryUri;
    }
    /**
     * Set directoryUri value
     * @throws \InvalidArgumentException
     * @param XDirectoryUri[] $directoryUri
     * @return DirectoryURIs
     */
    public function setDirectoryUri(array $directoryUri = array())
    {
        foreach ($directoryUri as $directoryURIsDirectoryUriItem) {
            // validation for constraint: itemType
            if (!$directoryURIsDirectoryUriItem instanceof XDirectoryUri) {
                throw new \InvalidArgumentException(sprintf('The directoryUri property can only contain items of XDirectoryUri, "%s" given', is_object($directoryURIsDirectoryUriItem) ? get_class($directoryURIsDirectoryUriItem) : gettype($directoryURIsDirectoryUriItem)), __LINE__);
            }
        }
        $this->directoryUri = $directoryUri;
        return $this;
    }
    /**
     * Add item to directoryUri value
     * @throws \InvalidArgumentException
     * @param XDirectoryUri $item
     * @return DirectoryURIs
     */
    public function addToDirectoryUri(XDirectoryUri $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof XDirectoryUri) {
            throw new \InvalidArgumentException(sprintf('The directoryUri property can only contain items of XDirectoryUri, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->directoryUri[] = $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 DirectoryURIs
     */
    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__;
    }
}
