<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

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