<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for audioSources StructType
 * Meta informations extracted from the WSDL
 * - documentation: If isMultiCastEnabled is false then these elements are not necessary.MOHServer will be added to the database without the values of these tags. ie. The table MOHServerMulticastInfo table will be empty. | If isMultiCastEnabled is false
 * then these elements are not necessary.MOHServer will be added to the database without the values of these tags. ie. The table MOHServerMulticastInfo table will be empty. | If isMultiCastEnabled is false then these elements are not necessary.MOHServer
 * will be added to the database without the values of these tags. ie. The table MOHServerMulticastInfo table will be empty.
 * @subpackage Structs
 */
class AudioSources extends AbstractStructBase
{
    /**
     * The audioSource
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var AudioSource[]
     */
    public $audioSource;
    /**
     * Constructor method for audioSources
     * @uses AudioSources::setAudioSource()
     * @param AudioSource[] $audioSource
     */
    public function __construct(array $audioSource = array())
    {
        $this
            ->setAudioSource($audioSource);
    }
    /**
     * Get audioSource value
     * @return AudioSource[]|null
     */
    public function getAudioSource()
    {
        return $this->audioSource;
    }
    /**
     * Set audioSource value
     * @throws \InvalidArgumentException
     * @param AudioSource[] $audioSource
     * @return AudioSources
     */
    public function setAudioSource(array $audioSource = array())
    {
        foreach ($audioSource as $audioSourcesAudioSourceItem) {
            // validation for constraint: itemType
            if (!$audioSourcesAudioSourceItem instanceof AudioSource) {
                throw new \InvalidArgumentException(sprintf('The audioSource property can only contain items of AudioSource, "%s" given', is_object($audioSourcesAudioSourceItem) ? get_class($audioSourcesAudioSourceItem) : gettype($audioSourcesAudioSourceItem)), __LINE__);
            }
        }
        $this->audioSource = $audioSource;
        return $this;
    }
    /**
     * Add item to audioSource value
     * @throws \InvalidArgumentException
     * @param AudioSource $item
     * @return AudioSources
     */
    public function addToAudioSource(AudioSource $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof AudioSource) {
            throw new \InvalidArgumentException(sprintf('The audioSource property can only contain items of AudioSource, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->audioSource[] = $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 AudioSources
     */
    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__;
    }
}
