<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

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