public static function toConstant($value)
    {
        if (false !== ($_index = array_search($value, static::getDefinedConstants()))) {
            return $_index;
        }

        throw new \InvalidArgumentException('The value "' . $value . '" has no associated constant.');
    }
public static function toConstant($value)
    {
        if (false !== ($_index = array_search($value, static::getDefinedConstants()))) {
            return $_index;
        }

        throw new \InvalidArgumentException('The value "' . $value . '" has no associated constant.');
    }
public static function toConstant ( $ value ) { if ( false !== ( $ _index = array_search ( $ value , static :: getDefinedConstants ( ) ) ) ) { return $ _index ; } throw new \ InvalidArgumentException ( 'The value "' . $ value . '" has no associated constant.' ) ; }
Given a VALUE, return the associated CONSTANT

@param string $value

@return string
Given a VALUE return the associated CONSTANT