private static function AllowedClassValues($calledClass)
    {
        if (!isset(self::$allowedValues[$calledClass]))
        {
            $values = array();
            
            $enumClass = new \ReflectionClass(get_class());
            $reflectionClass = new \ReflectionClass($calledClass);
            
            $methods = $reflectionClass->getMethods(\ReflectionMethod::IS_STATIC);
            foreach ($methods as $method)
            {
                if ($method->isPublic() && $method->getNumberOfParameters() == 0)
                {
                    //avoid self references
                    if (!$enumClass->hasMethod($method->name))
                    {
                        $result = $method->invoke(null);
                        if (get_class($result) == $calledClass)
                            $values[] = $result->Value();
                    }
                }
            }
            self::$allowedValues[$calledClass] = $values;
        }
        return self::$allowedValues[$calledClass];
    }
private static function AllowedClassValues($calledClass)
    {
        if (!isset(self::$allowedValues[$calledClass]))
        {
            $values = array();
            
            $enumClass = new \ReflectionClass(get_class());
            $reflectionClass = new \ReflectionClass($calledClass);
            
            $methods = $reflectionClass->getMethods(\ReflectionMethod::IS_STATIC);
            foreach ($methods as $method)
            {
                if ($method->isPublic() && $method->getNumberOfParameters() == 0)
                {
                    //avoid self references
                    if (!$enumClass->hasMethod($method->name))
                    {
                        $result = $method->invoke(null);
                        if (get_class($result) == $calledClass)
                            $values[] = $result->Value();
                    }
                }
            }
            self::$allowedValues[$calledClass] = $values;
        }
        return self::$allowedValues[$calledClass];
    }
private static function AllowedClassValues ( $ calledClass ) { if ( ! isset ( self :: $ allowedValues [ $ calledClass ] ) ) { $ values = array ( ) ; $ enumClass = new \ ReflectionClass ( get_class ( ) ) ; $ reflectionClass = new \ ReflectionClass ( $ calledClass ) ; $ methods = $ reflectionClass -> getMethods ( \ ReflectionMethod :: IS_STATIC ) ; foreach ( $ methods as $ method ) { if ( $ method -> isPublic ( ) && $ method -> getNumberOfParameters ( ) == 0 ) { //avoid self references if ( ! $ enumClass -> hasMethod ( $ method -> name ) ) { $ result = $ method -> invoke ( null ) ; if ( get_class ( $ result ) == $ calledClass ) $ values [ ] = $ result -> Value ( ) ; } } } self :: $ allowedValues [ $ calledClass ] = $ values ; } return self :: $ allowedValues [ $ calledClass ] ; }
Returns the allowed values for the given class
@param string $calledClass The class name
@return type
Returns the allowed values for the given class