public static function getEnum()
    {
        $enumClass = get_called_class();

        if (!isset(self::$ConstantsCache[$enumClass])) {
            $reflect = new \ReflectionClass($enumClass);
            self::$ConstantsCache[$enumClass] = $reflect->getConstants();
        }

        return self::$ConstantsCache[$enumClass];
    }
public static function getEnum()
    {
        $enumClass = get_called_class();

        if (!isset(self::$ConstantsCache[$enumClass])) {
            $reflect = new \ReflectionClass($enumClass);
            self::$ConstantsCache[$enumClass] = $reflect->getConstants();
        }

        return self::$ConstantsCache[$enumClass];
    }
public static function getEnum ( ) { $ enumClass = get_called_class ( ) ; if ( ! isset ( self :: $ ConstantsCache [ $ enumClass ] ) ) { $ reflect = new \ ReflectionClass ( $ enumClass ) ; self :: $ ConstantsCache [ $ enumClass ] = $ reflect -> getConstants ( ) ; } return self :: $ ConstantsCache [ $ enumClass ] ; }
Get all constants of called class.

This static methods uses an internal cache to not create a reflection on every call.

@return array a hash with your constants and their value
Get all constants of called class .