<?php

namespace EnumType;

/**
 * This class stands for ComponentsType EnumType
 * @subpackage Enumerations
 */
class ComponentsType
{
    /**
     * Constant for value 'FLIGHT'
     * @return string 'FLIGHT'
     */
    const VALUE_FLIGHT = 'FLIGHT';
    /**
     * Constant for value 'HOTEL'
     * @return string 'HOTEL'
     */
    const VALUE_HOTEL = 'HOTEL';
    /**
     * Constant for value 'TRANSPORT'
     * @return string 'TRANSPORT'
     */
    const VALUE_TRANSPORT = 'TRANSPORT';
    /**
     * Constant for value 'TERMINAL'
     * @return string 'TERMINAL'
     */
    const VALUE_TERMINAL = 'TERMINAL';
    /**
     * Return true if value is allowed
     * @uses self::getValidValues()
     * @param mixed $value value
     * @return bool true|false
     */
    public static function valueIsValid($value)
    {
        return ($value === null) || in_array($value, self::getValidValues(), true);
    }
    /**
     * Return allowed values
     * @uses self::VALUE_FLIGHT
     * @uses self::VALUE_HOTEL
     * @uses self::VALUE_TRANSPORT
     * @uses self::VALUE_TERMINAL
     * @return string[]
     */
    public static function getValidValues()
    {
        return array(
            self::VALUE_FLIGHT,
            self::VALUE_HOTEL,
            self::VALUE_TRANSPORT,
            self::VALUE_TERMINAL,
        );
    }
    /**
     * Method returning the class name
     * @return string __CLASS__
     */
    public function __toString()
    {
        return __CLASS__;
    }
}
