public static function getNameForOrdinal($enumType, $ordinal)
    {
        $constants = $enumType::values();
        $result = null;

        foreach ($constants as $constant) {
            if ($constant->getOrdinal() === $ordinal) {
                $result = $constant->getName();
                break;
            }
        }

        return $result;
    }
public static function getNameForOrdinal($enumType, $ordinal)
    {
        $constants = $enumType::values();
        $result = null;

        foreach ($constants as $constant) {
            if ($constant->getOrdinal() === $ordinal) {
                $result = $constant->getName();
                break;
            }
        }

        return $result;
    }
public static function getNameForOrdinal ( $ enumType , $ ordinal ) { $ constants = $ enumType :: values ( ) ; $ result = null ; foreach ( $ constants as $ constant ) { if ( $ constant -> getOrdinal ( ) === $ ordinal ) { $ result = $ constant -> getName ( ) ; break ; } } return $ result ; }
Returns the name of the enumeration constant of the specified enumeration
type with the specified ordinal.

@param string  $enumType The class name of the enumeration type from
which to return the ordinal of the enumeration
constant.
@param integer $ordinal  The ordinal of the enumeration constant to
return.

@return string|null The name of the enumeration constant of the specified
enumeration type with the specified ordinal on
success; `null` on failure.
Returns the name of the enumeration constant of the specified enumeration type with the specified ordinal .