<?php

namespace Sabre\EnhancedAirBook\Structs;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for OriginDestinationOption Structs
 * @subpackage Structs
 */
class OriginDestinationOption extends AbstractStructBase
{
    /**
     * The FlightSegment
     * Meta informations extracted from the WSDL
     * - maxOccurs: 10
     * - minOccurs: 0
     * @var \Sabre\EnhancedAirBook\Structs\FlightSegment[]
     */
    public $FlightSegment;
    /**
     * Constructor method for OriginDestinationOption
     * @uses OriginDestinationOption::setFlightSegment()
     * @param \Sabre\EnhancedAirBook\Structs\FlightSegment[] $flightSegment
     */
    public function __construct(array $flightSegment = array())
    {
        $this
            ->setFlightSegment($flightSegment);
    }
    /**
     * Get FlightSegment value
     * @return \Sabre\EnhancedAirBook\Structs\FlightSegment[]|null
     */
    public function getFlightSegment()
    {
        return $this->FlightSegment;
    }
    /**
     * Set FlightSegment value
     * @throws \InvalidArgumentException
     * @param \Sabre\EnhancedAirBook\Structs\FlightSegment[] $flightSegment
     * @return \Sabre\EnhancedAirBook\Structs\OriginDestinationOption
     */
    public function setFlightSegment(array $flightSegment = array())
    {
        $this->FlightSegment = $flightSegment;
        return $this;
    }
    /**
     * Add item to FlightSegment value
     * @throws \InvalidArgumentException
     * @param \Sabre\EnhancedAirBook\Structs\FlightSegment $item
     * @return \Sabre\EnhancedAirBook\Structs\OriginDestinationOption
     */
    public function addToFlightSegment(\Sabre\EnhancedAirBook\Structs\FlightSegment $item)
    {
        $this->FlightSegment[] = $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 \Sabre\EnhancedAirBook\Structs\OriginDestinationOption
     */
    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__;
    }
}
