<?php
use \WsdlToPhp\PackageBase\AbstractStructBase;

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