<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for CabinAvailabilityTypeMeal StructType
 * @package Dg
 * @subpackage Structs
 */
class DgCabinAvailabilityTypeMeal extends AbstractStructBase
{
    /**
     * The MealCode
     * @var string
     */
    public $MealCode;
    /**
     * Constructor method for CabinAvailabilityTypeMeal
     * @uses DgCabinAvailabilityTypeMeal::setMealCode()
     * @param string $mealCode
     */
    public function __construct($mealCode = null)
    {
        $this
            ->setMealCode($mealCode);
    }
    /**
     * Get MealCode value
     * @return string|null
     */
    public function getMealCode()
    {
        return $this->MealCode;
    }
    /**
     * Set MealCode value
     * @param string $mealCode
     * @return \dgsoft\StructType\DgCabinAvailabilityTypeMeal
     */
    public function setMealCode($mealCode = null)
    {
        // validation for constraint: string
        if (!is_null($mealCode) && !is_string($mealCode)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($mealCode)), __LINE__);
        }
        $this->MealCode = $mealCode;
        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\DgCabinAvailabilityTypeMeal
     */
    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__;
    }
}
