<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for CoveredTravelerTypeCoveredPerson StructType
 * @package Dg
 * @subpackage Structs
 */
class DgCoveredTravelerTypeCoveredPerson extends DgPersonNameType
{
    /**
     * The Relation
     * @var string
     */
    public $Relation;
    /**
     * The BirthDate
     * @var string
     */
    public $BirthDate;
    /**
     * The Age
     * @var int
     */
    public $Age;
    /**
     * The PassengerTypeCode
     * @var string
     */
    public $PassengerTypeCode;
    /**
     * Constructor method for CoveredTravelerTypeCoveredPerson
     * @uses DgCoveredTravelerTypeCoveredPerson::setRelation()
     * @uses DgCoveredTravelerTypeCoveredPerson::setBirthDate()
     * @uses DgCoveredTravelerTypeCoveredPerson::setAge()
     * @uses DgCoveredTravelerTypeCoveredPerson::setPassengerTypeCode()
     * @param string $relation
     * @param string $birthDate
     * @param int $age
     * @param string $passengerTypeCode
     */
    public function __construct($relation = null, $birthDate = null, $age = null, $passengerTypeCode = null)
    {
        $this
            ->setRelation($relation)
            ->setBirthDate($birthDate)
            ->setAge($age)
            ->setPassengerTypeCode($passengerTypeCode);
    }
    /**
     * Get Relation value
     * @return string|null
     */
    public function getRelation()
    {
        return $this->Relation;
    }
    /**
     * Set Relation value
     * @param string $relation
     * @return \dgsoft\StructType\DgCoveredTravelerTypeCoveredPerson
     */
    public function setRelation($relation = null)
    {
        // validation for constraint: string
        if (!is_null($relation) && !is_string($relation)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($relation)), __LINE__);
        }
        $this->Relation = $relation;
        return $this;
    }
    /**
     * Get BirthDate value
     * @return string|null
     */
    public function getBirthDate()
    {
        return $this->BirthDate;
    }
    /**
     * Set BirthDate value
     * @param string $birthDate
     * @return \dgsoft\StructType\DgCoveredTravelerTypeCoveredPerson
     */
    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 Age value
     * @return int|null
     */
    public function getAge()
    {
        return $this->Age;
    }
    /**
     * Set Age value
     * @param int $age
     * @return \dgsoft\StructType\DgCoveredTravelerTypeCoveredPerson
     */
    public function setAge($age = null)
    {
        // validation for constraint: int
        if (!is_null($age) && !is_numeric($age)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a numeric value, "%s" given', gettype($age)), __LINE__);
        }
        $this->Age = $age;
        return $this;
    }
    /**
     * Get PassengerTypeCode value
     * @return string|null
     */
    public function getPassengerTypeCode()
    {
        return $this->PassengerTypeCode;
    }
    /**
     * Set PassengerTypeCode value
     * @param string $passengerTypeCode
     * @return \dgsoft\StructType\DgCoveredTravelerTypeCoveredPerson
     */
    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;
    }
    /**
     * 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\DgCoveredTravelerTypeCoveredPerson
     */
    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__;
    }
}
