<?php

namespace StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for JP_FareGroupService StructType
 * @subpackage Structs
 */
class JP_FareGroupService extends AbstractStructBase
{
    /**
     * The TypeCode
     * Meta informations extracted from the WSDL
     * - use: required
     * @var int
     */
    public $TypeCode;
    /**
     * The PriceApplicationCode
     * Meta informations extracted from the WSDL
     * - use: required
     * @var int
     */
    public $PriceApplicationCode;
    /**
     * Constructor method for JP_FareGroupService
     * @uses JP_FareGroupService::setTypeCode()
     * @uses JP_FareGroupService::setPriceApplicationCode()
     * @param int $typeCode
     * @param int $priceApplicationCode
     */
    public function __construct($typeCode = null, $priceApplicationCode = null)
    {
        $this
            ->setTypeCode($typeCode)
            ->setPriceApplicationCode($priceApplicationCode);
    }
    /**
     * Get TypeCode value
     * @return int
     */
    public function getTypeCode()
    {
        return $this->TypeCode;
    }
    /**
     * Set TypeCode value
     * @param int $typeCode
     * @return \StructType\JP_FareGroupService
     */
    public function setTypeCode($typeCode = null)
    {
        // validation for constraint: int
        if (!is_null($typeCode) && !(is_int($typeCode) || ctype_digit($typeCode))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($typeCode, true), gettype($typeCode)), __LINE__);
        }
        $this->TypeCode = $typeCode;
        return $this;
    }
    /**
     * Get PriceApplicationCode value
     * @return int
     */
    public function getPriceApplicationCode()
    {
        return $this->PriceApplicationCode;
    }
    /**
     * Set PriceApplicationCode value
     * @param int $priceApplicationCode
     * @return \StructType\JP_FareGroupService
     */
    public function setPriceApplicationCode($priceApplicationCode = null)
    {
        // validation for constraint: int
        if (!is_null($priceApplicationCode) && !(is_int($priceApplicationCode) || ctype_digit($priceApplicationCode))) {
            throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide an integer value, %s given', var_export($priceApplicationCode, true), gettype($priceApplicationCode)), __LINE__);
        }
        $this->PriceApplicationCode = $priceApplicationCode;
        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 \StructType\JP_FareGroupService
     */
    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__;
    }
}
