<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for OTA_AirSeatMapRSSeatMapResponsesAirTraveler StructType
 * @package Dg
 * @subpackage Structs
 */
class DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler extends AbstractStructBase
{
    /**
     * The PersonName
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgPersonNameType
     */
    public $PersonName;
    /**
     * The CustLoyalty
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTravelerCustLoyalty[]
     */
    public $CustLoyalty;
    /**
     * The PassengerTypeQuantity
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgPassengerTypeQuantityType
     */
    public $PassengerTypeQuantity;
    /**
     * The TravelerRefNumber
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTravelerTravelerRefNumber
     */
    public $TravelerRefNumber;
    /**
     * The Gender
     * @var string
     */
    public $Gender;
    /**
     * The ShareSynchInd
     * @var string
     */
    public $ShareSynchInd;
    /**
     * The ShareMarketInd
     * @var string
     */
    public $ShareMarketInd;
    /**
     * The BirthDate
     * @var string
     */
    public $BirthDate;
    /**
     * The CurrencyCode
     * @var string
     */
    public $CurrencyCode;
    /**
     * The PassengerTypeCode
     * @var string
     */
    public $PassengerTypeCode;
    /**
     * The AccompaniedByInfant
     * @var bool
     */
    public $AccompaniedByInfant;
    /**
     * Constructor method for OTA_AirSeatMapRSSeatMapResponsesAirTraveler
     * @uses DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler::setPersonName()
     * @uses DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler::setCustLoyalty()
     * @uses DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler::setPassengerTypeQuantity()
     * @uses DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler::setTravelerRefNumber()
     * @uses DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler::setGender()
     * @uses DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler::setShareSynchInd()
     * @uses DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler::setShareMarketInd()
     * @uses DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler::setBirthDate()
     * @uses DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler::setCurrencyCode()
     * @uses DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler::setPassengerTypeCode()
     * @uses DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler::setAccompaniedByInfant()
     * @param \dgsoft\StructType\DgPersonNameType $personName
     * @param \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTravelerCustLoyalty[] $custLoyalty
     * @param \dgsoft\StructType\DgPassengerTypeQuantityType $passengerTypeQuantity
     * @param \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTravelerTravelerRefNumber $travelerRefNumber
     * @param string $gender
     * @param string $shareSynchInd
     * @param string $shareMarketInd
     * @param string $birthDate
     * @param string $currencyCode
     * @param string $passengerTypeCode
     * @param bool $accompaniedByInfant
     */
    public function __construct(\dgsoft\StructType\DgPersonNameType $personName = null, array $custLoyalty = array(), \dgsoft\StructType\DgPassengerTypeQuantityType $passengerTypeQuantity = null, \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTravelerTravelerRefNumber $travelerRefNumber = null, $gender = null, $shareSynchInd = null, $shareMarketInd = null, $birthDate = null, $currencyCode = null, $passengerTypeCode = null, $accompaniedByInfant = null)
    {
        $this
            ->setPersonName($personName)
            ->setCustLoyalty($custLoyalty)
            ->setPassengerTypeQuantity($passengerTypeQuantity)
            ->setTravelerRefNumber($travelerRefNumber)
            ->setGender($gender)
            ->setShareSynchInd($shareSynchInd)
            ->setShareMarketInd($shareMarketInd)
            ->setBirthDate($birthDate)
            ->setCurrencyCode($currencyCode)
            ->setPassengerTypeCode($passengerTypeCode)
            ->setAccompaniedByInfant($accompaniedByInfant);
    }
    /**
     * Get PersonName value
     * @return \dgsoft\StructType\DgPersonNameType|null
     */
    public function getPersonName()
    {
        return $this->PersonName;
    }
    /**
     * Set PersonName value
     * @param \dgsoft\StructType\DgPersonNameType $personName
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler
     */
    public function setPersonName(\dgsoft\StructType\DgPersonNameType $personName = null)
    {
        $this->PersonName = $personName;
        return $this;
    }
    /**
     * Get CustLoyalty value
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTravelerCustLoyalty[]|null
     */
    public function getCustLoyalty()
    {
        return $this->CustLoyalty;
    }
    /**
     * Set CustLoyalty value
     * @throws \InvalidArgumentException
     * @param \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTravelerCustLoyalty[] $custLoyalty
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler
     */
    public function setCustLoyalty(array $custLoyalty = array())
    {
        foreach ($custLoyalty as $oTA_AirSeatMapRSSeatMapResponsesAirTravelerCustLoyaltyItem) {
            // validation for constraint: itemType
            if (!$oTA_AirSeatMapRSSeatMapResponsesAirTravelerCustLoyaltyItem instanceof \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTravelerCustLoyalty) {
                throw new \InvalidArgumentException(sprintf('The CustLoyalty property can only contain items of \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTravelerCustLoyalty, "%s" given', is_object($oTA_AirSeatMapRSSeatMapResponsesAirTravelerCustLoyaltyItem) ? get_class($oTA_AirSeatMapRSSeatMapResponsesAirTravelerCustLoyaltyItem) : gettype($oTA_AirSeatMapRSSeatMapResponsesAirTravelerCustLoyaltyItem)), __LINE__);
            }
        }
        $this->CustLoyalty = $custLoyalty;
        return $this;
    }
    /**
     * Add item to CustLoyalty value
     * @throws \InvalidArgumentException
     * @param \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTravelerCustLoyalty $item
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler
     */
    public function addToCustLoyalty(\dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTravelerCustLoyalty $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTravelerCustLoyalty) {
            throw new \InvalidArgumentException(sprintf('The CustLoyalty property can only contain items of \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTravelerCustLoyalty, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->CustLoyalty[] = $item;
        return $this;
    }
    /**
     * Get PassengerTypeQuantity value
     * @return \dgsoft\StructType\DgPassengerTypeQuantityType|null
     */
    public function getPassengerTypeQuantity()
    {
        return $this->PassengerTypeQuantity;
    }
    /**
     * Set PassengerTypeQuantity value
     * @param \dgsoft\StructType\DgPassengerTypeQuantityType $passengerTypeQuantity
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler
     */
    public function setPassengerTypeQuantity(\dgsoft\StructType\DgPassengerTypeQuantityType $passengerTypeQuantity = null)
    {
        $this->PassengerTypeQuantity = $passengerTypeQuantity;
        return $this;
    }
    /**
     * Get TravelerRefNumber value
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTravelerTravelerRefNumber|null
     */
    public function getTravelerRefNumber()
    {
        return $this->TravelerRefNumber;
    }
    /**
     * Set TravelerRefNumber value
     * @param \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTravelerTravelerRefNumber $travelerRefNumber
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler
     */
    public function setTravelerRefNumber(\dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTravelerTravelerRefNumber $travelerRefNumber = null)
    {
        $this->TravelerRefNumber = $travelerRefNumber;
        return $this;
    }
    /**
     * Get Gender value
     * @return string|null
     */
    public function getGender()
    {
        return $this->Gender;
    }
    /**
     * Set Gender value
     * @uses \dgsoft\EnumType\DgOTA_AirSeatMapRSSeatMapResponsesAirTravelerGender::valueIsValid()
     * @uses \dgsoft\EnumType\DgOTA_AirSeatMapRSSeatMapResponsesAirTravelerGender::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $gender
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler
     */
    public function setGender($gender = null)
    {
        // validation for constraint: enumeration
        if (!\dgsoft\EnumType\DgOTA_AirSeatMapRSSeatMapResponsesAirTravelerGender::valueIsValid($gender)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $gender, implode(', ', \dgsoft\EnumType\DgOTA_AirSeatMapRSSeatMapResponsesAirTravelerGender::getValidValues())), __LINE__);
        }
        $this->Gender = $gender;
        return $this;
    }
    /**
     * Get ShareSynchInd value
     * @return string|null
     */
    public function getShareSynchInd()
    {
        return $this->ShareSynchInd;
    }
    /**
     * Set ShareSynchInd value
     * @param string $shareSynchInd
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler
     */
    public function setShareSynchInd($shareSynchInd = null)
    {
        // validation for constraint: string
        if (!is_null($shareSynchInd) && !is_string($shareSynchInd)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shareSynchInd)), __LINE__);
        }
        $this->ShareSynchInd = $shareSynchInd;
        return $this;
    }
    /**
     * Get ShareMarketInd value
     * @return string|null
     */
    public function getShareMarketInd()
    {
        return $this->ShareMarketInd;
    }
    /**
     * Set ShareMarketInd value
     * @param string $shareMarketInd
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler
     */
    public function setShareMarketInd($shareMarketInd = null)
    {
        // validation for constraint: string
        if (!is_null($shareMarketInd) && !is_string($shareMarketInd)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($shareMarketInd)), __LINE__);
        }
        $this->ShareMarketInd = $shareMarketInd;
        return $this;
    }
    /**
     * Get BirthDate value
     * @return string|null
     */
    public function getBirthDate()
    {
        return $this->BirthDate;
    }
    /**
     * Set BirthDate value
     * @param string $birthDate
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler
     */
    public function setBirthDate($birthDate = null)
    {
        // validation for constraint: string
        if (!is_null($birthDate) && !is_string($birthDate)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($birthDate)), __LINE__);
        }
        $this->BirthDate = $birthDate;
        return $this;
    }
    /**
     * Get CurrencyCode value
     * @return string|null
     */
    public function getCurrencyCode()
    {
        return $this->CurrencyCode;
    }
    /**
     * Set CurrencyCode value
     * @param string $currencyCode
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler
     */
    public function setCurrencyCode($currencyCode = null)
    {
        // validation for constraint: string
        if (!is_null($currencyCode) && !is_string($currencyCode)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($currencyCode)), __LINE__);
        }
        $this->CurrencyCode = $currencyCode;
        return $this;
    }
    /**
     * Get PassengerTypeCode value
     * @return string|null
     */
    public function getPassengerTypeCode()
    {
        return $this->PassengerTypeCode;
    }
    /**
     * Set PassengerTypeCode value
     * @param string $passengerTypeCode
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler
     */
    public function setPassengerTypeCode($passengerTypeCode = null)
    {
        // validation for constraint: string
        if (!is_null($passengerTypeCode) && !is_string($passengerTypeCode)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($passengerTypeCode)), __LINE__);
        }
        $this->PassengerTypeCode = $passengerTypeCode;
        return $this;
    }
    /**
     * Get AccompaniedByInfant value
     * @return bool|null
     */
    public function getAccompaniedByInfant()
    {
        return $this->AccompaniedByInfant;
    }
    /**
     * Set AccompaniedByInfant value
     * @param bool $accompaniedByInfant
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler
     */
    public function setAccompaniedByInfant($accompaniedByInfant = null)
    {
        // validation for constraint: boolean
        if (!is_null($accompaniedByInfant) && !is_bool($accompaniedByInfant)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($accompaniedByInfant)), __LINE__);
        }
        $this->AccompaniedByInfant = $accompaniedByInfant;
        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 \dgsoft\StructType\DgOTA_AirSeatMapRSSeatMapResponsesAirTraveler
     */
    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__;
    }
}
