<?php
/**
 * This class stands for XReleaseCauseValue EnumType
 * @subpackage Enumerations
 */
class XReleaseCauseValue
{
    /**
     * Constant for value 'No Error'
     * @return string 'No Error'
     */
    const VALUE_NO_ERROR = 'No Error';
    /**
     * Constant for value 'Unallocated Number'
     * @return string 'Unallocated Number'
     */
    const VALUE_UNALLOCATED_NUMBER = 'Unallocated Number';
    /**
     * Constant for value 'Call Rejected'
     * @return string 'Call Rejected'
     */
    const VALUE_CALL_REJECTED = 'Call Rejected';
    /**
     * Constant for value 'Number Changed'
     * @return string 'Number Changed'
     */
    const VALUE_NUMBER_CHANGED = 'Number Changed';
    /**
     * Constant for value 'Invalid Number Format'
     * @return string 'Invalid Number Format'
     */
    const VALUE_INVALID_NUMBER_FORMAT = 'Invalid Number Format';
    /**
     * Constant for value 'Precedence Level Exceeded'
     * @return string 'Precedence Level Exceeded'
     */
    const VALUE_PRECEDENCE_LEVEL_EXCEEDED = 'Precedence Level Exceeded';
    /**
     * 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_NO_ERROR
     * @uses self::VALUE_UNALLOCATED_NUMBER
     * @uses self::VALUE_CALL_REJECTED
     * @uses self::VALUE_NUMBER_CHANGED
     * @uses self::VALUE_INVALID_NUMBER_FORMAT
     * @uses self::VALUE_PRECEDENCE_LEVEL_EXCEEDED
     * @return string[]
     */
    public static function getValidValues()
    {
        return array(
            self::VALUE_NO_ERROR,
            self::VALUE_UNALLOCATED_NUMBER,
            self::VALUE_CALL_REJECTED,
            self::VALUE_NUMBER_CHANGED,
            self::VALUE_INVALID_NUMBER_FORMAT,
            self::VALUE_PRECEDENCE_LEVEL_EXCEEDED,
        );
    }
    /**
     * Method returning the class name
     * @return string __CLASS__
     */
    public function __toString()
    {
        return __CLASS__;
    }
}
