<?php

namespace Sabre\PassengerDetailsRQ\Structs;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for TravelPortions Structs
 * Meta informations extracted from the WSDL
 * - documentation: "TravelPortions" element is used as a container for Travel portion, assiociated with particular ancillary service, details.
 * @subpackage Structs
 */
class TravelPortions extends AbstractStructBase
{
    /**
     * The TravelPortion
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \Sabre\PassengerDetailsRQ\Structs\TravelPortion[]
     */
    public $TravelPortion;
    /**
     * Constructor method for TravelPortions
     * @uses TravelPortions::setTravelPortion()
     * @param \Sabre\PassengerDetailsRQ\Structs\TravelPortion[] $travelPortion
     */
    public function __construct(array $travelPortion = array())
    {
        $this
            ->setTravelPortion($travelPortion);
    }
    /**
     * Get TravelPortion value
     * @return \Sabre\PassengerDetailsRQ\Structs\TravelPortion[]|null
     */
    public function getTravelPortion()
    {
        return $this->TravelPortion;
    }
    /**
     * Set TravelPortion value
     * @throws \InvalidArgumentException
     * @param \Sabre\PassengerDetailsRQ\Structs\TravelPortion[] $travelPortion
     * @return \Sabre\PassengerDetailsRQ\Structs\TravelPortions
     */
    public function setTravelPortion(array $travelPortion = array())
    {
        $this->TravelPortion = $travelPortion;
        return $this;
    }
    /**
     * Add item to TravelPortion value
     * @throws \InvalidArgumentException
     * @param \Sabre\PassengerDetailsRQ\Structs\TravelPortion $item
     * @return \Sabre\PassengerDetailsRQ\Structs\TravelPortions
     */
    public function addToTravelPortion(\Sabre\PassengerDetailsRQ\Structs\TravelPortion $item)
    {
        $this->TravelPortion[] = $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\PassengerDetailsRQ\Structs\TravelPortions
     */
    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__;
    }
}
