<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

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