<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for associatedTodAccess StructType
 * @subpackage Structs
 */
class AssociatedTodAccess extends AbstractStructBase
{
    /**
     * The todAccess
     * Meta informations extracted from the WSDL
     * - documentation: Name of the todAccess.
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var string[]
     */
    public $todAccess;
    /**
     * Constructor method for associatedTodAccess
     * @uses AssociatedTodAccess::setTodAccess()
     * @param string[] $todAccess
     */
    public function __construct(array $todAccess = array())
    {
        $this
            ->setTodAccess($todAccess);
    }
    /**
     * Get todAccess value
     * @return string[]|null
     */
    public function getTodAccess()
    {
        return $this->todAccess;
    }
    /**
     * Set todAccess value
     * @throws \InvalidArgumentException
     * @param string[] $todAccess
     * @return AssociatedTodAccess
     */
    public function setTodAccess(array $todAccess = array())
    {
        foreach ($todAccess as $associatedTodAccessTodAccessItem) {
            // validation for constraint: itemType
            if (!is_string($associatedTodAccessTodAccessItem)) {
                throw new \InvalidArgumentException(sprintf('The todAccess property can only contain items of string, "%s" given', is_object($associatedTodAccessTodAccessItem) ? get_class($associatedTodAccessTodAccessItem) : gettype($associatedTodAccessTodAccessItem)), __LINE__);
            }
        }
        $this->todAccess = $todAccess;
        return $this;
    }
    /**
     * Add item to todAccess value
     * @throws \InvalidArgumentException
     * @param string $item
     * @return AssociatedTodAccess
     */
    public function addToTodAccess($item)
    {
        // validation for constraint: itemType
        if (!is_string($item)) {
            throw new \InvalidArgumentException(sprintf('The todAccess property can only contain items of string, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->todAccess[] = $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 AssociatedTodAccess
     */
    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__;
    }
}
