<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for FareRuleResponseInfoTypeFareRuleInfo StructType
 * @package Dg
 * @subpackage Structs
 */
class DgFareRuleResponseInfoTypeFareRuleInfo extends DgFareInfoType
{
    /**
     * The FareRules
     * Meta informations extracted from the WSDL
     * - maxOccurs: 1
     * - minOccurs: 0
     * @var \dgsoft\StructType\DgFormattedTextType
     */
    public $FareRules;
    /**
     * The LanguageRequested
     * @var string
     */
    public $LanguageRequested;
    /**
     * The LanguageReturned
     * @var string
     */
    public $LanguageReturned;
    /**
     * Constructor method for FareRuleResponseInfoTypeFareRuleInfo
     * @uses DgFareRuleResponseInfoTypeFareRuleInfo::setFareRules()
     * @uses DgFareRuleResponseInfoTypeFareRuleInfo::setLanguageRequested()
     * @uses DgFareRuleResponseInfoTypeFareRuleInfo::setLanguageReturned()
     * @param \dgsoft\StructType\DgFormattedTextType $fareRules
     * @param string $languageRequested
     * @param string $languageReturned
     */
    public function __construct(\dgsoft\StructType\DgFormattedTextType $fareRules = null, $languageRequested = null, $languageReturned = null)
    {
        $this
            ->setFareRules($fareRules)
            ->setLanguageRequested($languageRequested)
            ->setLanguageReturned($languageReturned);
    }
    /**
     * Get FareRules value
     * @return \dgsoft\StructType\DgFormattedTextType|null
     */
    public function getFareRules()
    {
        return $this->FareRules;
    }
    /**
     * Set FareRules value
     * @param \dgsoft\StructType\DgFormattedTextType $fareRules
     * @return \dgsoft\StructType\DgFareRuleResponseInfoTypeFareRuleInfo
     */
    public function setFareRules(\dgsoft\StructType\DgFormattedTextType $fareRules = null)
    {
        $this->FareRules = $fareRules;
        return $this;
    }
    /**
     * Get LanguageRequested value
     * @return string|null
     */
    public function getLanguageRequested()
    {
        return $this->LanguageRequested;
    }
    /**
     * Set LanguageRequested value
     * @param string $languageRequested
     * @return \dgsoft\StructType\DgFareRuleResponseInfoTypeFareRuleInfo
     */
    public function setLanguageRequested($languageRequested = null)
    {
        // validation for constraint: string
        if (!is_null($languageRequested) && !is_string($languageRequested)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($languageRequested)), __LINE__);
        }
        $this->LanguageRequested = $languageRequested;
        return $this;
    }
    /**
     * Get LanguageReturned value
     * @return string|null
     */
    public function getLanguageReturned()
    {
        return $this->LanguageReturned;
    }
    /**
     * Set LanguageReturned value
     * @param string $languageReturned
     * @return \dgsoft\StructType\DgFareRuleResponseInfoTypeFareRuleInfo
     */
    public function setLanguageReturned($languageReturned = null)
    {
        // validation for constraint: string
        if (!is_null($languageReturned) && !is_string($languageReturned)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($languageReturned)), __LINE__);
        }
        $this->LanguageReturned = $languageReturned;
        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\DgFareRuleResponseInfoTypeFareRuleInfo
     */
    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__;
    }
}
