<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for locationContainedInItinerary StructType
 * @subpackage Structs
 */
class LocationContainedInItinerary extends Location
{
    /**
     * The index
     * Meta informations extracted from the WSDL
     * - use: required
     * @var int
     */
    public $index;
    /**
     * Constructor method for locationContainedInItinerary
     * @uses LocationContainedInItinerary::setIndex()
     * @param int $index
     */
    public function __construct($index = null)
    {
        $this
            ->setIndex($index);
    }
    /**
     * Get index value
     * @return int
     */
    public function getIndex()
    {
        return $this->index;
    }
    /**
     * Set index value
     * @param int $index
     * @return \StructType\LocationContainedInItinerary
     */
    public function setIndex($index = null)
    {
        // validation for constraint: int
        if (!is_null($index) && !is_numeric($index)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($index)), __LINE__);
        }
        $this->index = $index;
        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 \StructType\LocationContainedInItinerary
     */
    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__;
    }
}
