<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

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