<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

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