<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for OTA_AirSeatMapRQSeatMapRequestSeatDetailsCabinClass
 * StructType
 * @package Dg
 * @subpackage Structs
 */
class DgOTA_AirSeatMapRQSeatMapRequestSeatDetailsCabinClass extends AbstractStructBase
{
    /**
     * The CabinType
     * @var string
     */
    public $CabinType;
    /**
     * Constructor method for OTA_AirSeatMapRQSeatMapRequestSeatDetailsCabinClass
     * @uses DgOTA_AirSeatMapRQSeatMapRequestSeatDetailsCabinClass::setCabinType()
     * @param string $cabinType
     */
    public function __construct($cabinType = null)
    {
        $this
            ->setCabinType($cabinType);
    }
    /**
     * Get CabinType value
     * @return string|null
     */
    public function getCabinType()
    {
        return $this->CabinType;
    }
    /**
     * Set CabinType value
     * @uses \dgsoft\EnumType\DgCabinType::valueIsValid()
     * @uses \dgsoft\EnumType\DgCabinType::getValidValues()
     * @throws \InvalidArgumentException
     * @param string $cabinType
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRQSeatMapRequestSeatDetailsCabinClass
     */
    public function setCabinType($cabinType = null)
    {
        // validation for constraint: enumeration
        if (!\dgsoft\EnumType\DgCabinType::valueIsValid($cabinType)) {
            throw new \InvalidArgumentException(sprintf('Value "%s" is invalid, please use one of: %s', $cabinType, implode(', ', \dgsoft\EnumType\DgCabinType::getValidValues())), __LINE__);
        }
        $this->CabinType = $cabinType;
        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_AirSeatMapRQSeatMapRequestSeatDetailsCabinClass
     */
    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__;
    }
}
