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

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

        return $result;
    }