<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for OTA_AirSeatMapRQSeatMapRequestSeatDetails StructType
 * @package Dg
 * @subpackage Structs
 */
class DgOTA_AirSeatMapRQSeatMapRequestSeatDetails extends AbstractStructBase
{
    /**
     * The CabinClass
     * Meta informations extracted from the WSDL
     * - maxOccurs: unbounded
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgOTA_AirSeatMapRQSeatMapRequestSeatDetailsCabinClass[]
     */
    public $CabinClass;
    /**
     * The ResBookDesignations
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \dgsoft\ArrayType\DgArrayOfOTA_AirSeatMapRQSeatMapRequestSeatDetailsResBookDesignation
     */
    public $ResBookDesignations;
    /**
     * The SeatUpgrade
     * Meta informations extracted from the WSDL
     * - default: false
     * @var bool
     */
    public $SeatUpgrade;
    /**
     * Constructor method for OTA_AirSeatMapRQSeatMapRequestSeatDetails
     * @uses DgOTA_AirSeatMapRQSeatMapRequestSeatDetails::setCabinClass()
     * @uses DgOTA_AirSeatMapRQSeatMapRequestSeatDetails::setResBookDesignations()
     * @uses DgOTA_AirSeatMapRQSeatMapRequestSeatDetails::setSeatUpgrade()
     * @param \dgsoft\StructType\DgOTA_AirSeatMapRQSeatMapRequestSeatDetailsCabinClass[] $cabinClass
     * @param \dgsoft\ArrayType\DgArrayOfOTA_AirSeatMapRQSeatMapRequestSeatDetailsResBookDesignation $resBookDesignations
     * @param bool $seatUpgrade
     */
    public function __construct(array $cabinClass = array(), \dgsoft\ArrayType\DgArrayOfOTA_AirSeatMapRQSeatMapRequestSeatDetailsResBookDesignation $resBookDesignations = null, $seatUpgrade = false)
    {
        $this
            ->setCabinClass($cabinClass)
            ->setResBookDesignations($resBookDesignations)
            ->setSeatUpgrade($seatUpgrade);
    }
    /**
     * Get CabinClass value
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRQSeatMapRequestSeatDetailsCabinClass[]|null
     */
    public function getCabinClass()
    {
        return $this->CabinClass;
    }
    /**
     * Set CabinClass value
     * @throws \InvalidArgumentException
     * @param \dgsoft\StructType\DgOTA_AirSeatMapRQSeatMapRequestSeatDetailsCabinClass[] $cabinClass
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRQSeatMapRequestSeatDetails
     */
    public function setCabinClass(array $cabinClass = array())
    {
        foreach ($cabinClass as $oTA_AirSeatMapRQSeatMapRequestSeatDetailsCabinClassItem) {
            // validation for constraint: itemType
            if (!$oTA_AirSeatMapRQSeatMapRequestSeatDetailsCabinClassItem instanceof \dgsoft\StructType\DgOTA_AirSeatMapRQSeatMapRequestSeatDetailsCabinClass) {
                throw new \InvalidArgumentException(sprintf('The CabinClass property can only contain items of \dgsoft\StructType\DgOTA_AirSeatMapRQSeatMapRequestSeatDetailsCabinClass, "%s" given', is_object($oTA_AirSeatMapRQSeatMapRequestSeatDetailsCabinClassItem) ? get_class($oTA_AirSeatMapRQSeatMapRequestSeatDetailsCabinClassItem) : gettype($oTA_AirSeatMapRQSeatMapRequestSeatDetailsCabinClassItem)), __LINE__);
            }
        }
        $this->CabinClass = $cabinClass;
        return $this;
    }
    /**
     * Add item to CabinClass value
     * @throws \InvalidArgumentException
     * @param \dgsoft\StructType\DgOTA_AirSeatMapRQSeatMapRequestSeatDetailsCabinClass $item
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRQSeatMapRequestSeatDetails
     */
    public function addToCabinClass(\dgsoft\StructType\DgOTA_AirSeatMapRQSeatMapRequestSeatDetailsCabinClass $item)
    {
        // validation for constraint: itemType
        if (!$item instanceof \dgsoft\StructType\DgOTA_AirSeatMapRQSeatMapRequestSeatDetailsCabinClass) {
            throw new \InvalidArgumentException(sprintf('The CabinClass property can only contain items of \dgsoft\StructType\DgOTA_AirSeatMapRQSeatMapRequestSeatDetailsCabinClass, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
        }
        $this->CabinClass[] = $item;
        return $this;
    }
    /**
     * Get ResBookDesignations value
     * @return \dgsoft\ArrayType\DgArrayOfOTA_AirSeatMapRQSeatMapRequestSeatDetailsResBookDesignation|null
     */
    public function getResBookDesignations()
    {
        return $this->ResBookDesignations;
    }
    /**
     * Set ResBookDesignations value
     * @param \dgsoft\ArrayType\DgArrayOfOTA_AirSeatMapRQSeatMapRequestSeatDetailsResBookDesignation $resBookDesignations
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRQSeatMapRequestSeatDetails
     */
    public function setResBookDesignations(\dgsoft\ArrayType\DgArrayOfOTA_AirSeatMapRQSeatMapRequestSeatDetailsResBookDesignation $resBookDesignations = null)
    {
        $this->ResBookDesignations = $resBookDesignations;
        return $this;
    }
    /**
     * Get SeatUpgrade value
     * @return bool|null
     */
    public function getSeatUpgrade()
    {
        return $this->SeatUpgrade;
    }
    /**
     * Set SeatUpgrade value
     * @param bool $seatUpgrade
     * @return \dgsoft\StructType\DgOTA_AirSeatMapRQSeatMapRequestSeatDetails
     */
    public function setSeatUpgrade($seatUpgrade = false)
    {
        // validation for constraint: boolean
        if (!is_null($seatUpgrade) && !is_bool($seatUpgrade)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a bool, "%s" given', gettype($seatUpgrade)), __LINE__);
        }
        $this->SeatUpgrade = $seatUpgrade;
        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_AirSeatMapRQSeatMapRequestSeatDetails
     */
    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__;
    }
}
