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

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

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

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

        return $result;
    }
public static function isDefinedOrdinal ( $ enumType , $ ordinal ) { $ constants = $ enumType :: values ( ) ; $ result = false ; foreach ( $ constants as $ constant ) { if ( $ constant -> getOrdinal ( ) === $ ordinal ) { $ result = true ; break ; } } return $ result ; }
Checks whether an enumeration constant with the specified ordinal exists
in the specified enumeration type.

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

@return boolean `true` if the enumeration constant with the specified
ordinal exists in the specified enumeration type; `false`
otherwise.
Checks whether an enumeration constant with the specified ordinal exists in the specified enumeration type .