Returns the allowed values for the given class
@param string $calledClass The class name
@return type
191318
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];
    }
1201524
public function getParent($class)
    {
        $classId = $this->getClassId($class);
        if (!isset($classId)) {
            return false;
        }
        $parentClassId = $this->extends[$classId];
        return isset($parentClassId) ? $this->classes[$parentClassId[0]] : null;
    }
1196462
final public function whereInstanceOf(string $class)
    {
        if ($this->class === $class) {
            return $this;
        }

        if (!is_a($class, $this->class->getClassName(), true)) {
            throw InvalidArgumentException::format(
                'Invalid class supplied to %s: must be an a subclass of %s, %s given',
                __METHOD__, $this->class->getClassName(), $class
            );
        }

        $this->append(new InstanceOfCondition($class));
        
        if (!$this->isOrMode) {
            $this->class = $class::definition();
        }

        return $this;
    }
1122222
private static function getClass($type)
    {
        if (!\array_key_exists($type, self::$types)) {
            throw new \RuntimeException('invalid type');
        }

        return self::$types[$type];
    }
781640
public function getClassProperties($class)
    {
        $result = '';
        foreach($class->getProperties(\ReflectionProperty::IS_PUBLIC) as $property)
        {
            $static = $property->isStatic() ? ' static' : '';
            $name = $property->name;
            $result .= <<<CODE
    public{$static} \${$name};

CODE;
        }
        return $result;
    }
372766
public static function getType($value, bool $passString = false): string
    {
        if (is_object($value)) {
            return get_class($value);
        } elseif ($passString && is_string($value)) {
            return $value;
        } else {
            return gettype($value);
        }
    }
886254
private function getClass($mixed = null)
        {
            if (is_object($mixed)) {
                return get_class($mixed);
            }

            if (!is_null($mixed)) {
                return $mixed;
            }

            return $this->getCalledClass();
        }
391837
private function get_class($mixed=null)
	{
		if (is_object($mixed))
			return get_class($mixed);

		if (!is_null($mixed))
			return $mixed;

		return $this->get_called_class();
	}
495264
public function forClass(string $class): array
    {
        if (!class_exists($class)) {
            throw new InvalidArgumentException("Cannot get meta for non-exist class '$class'");
        }

        $reflection = $this->factory->reflectClass($class);

        $meta = $this->getClassMeta($reflection);
        $meta['@properties'] = $this->getPropertiesMeta($reflection);

        return $meta;
    }
1042485
public function getByModelClass($class)
    {
        $this->checkInitialization();

        if ( ! array_key_exists($class, $this->modelClassIndex)) {
            return false;
        }

        return $this->getByKey($this->modelClassIndex[$class]);
    }
1353659
protected function getAllowedRelations($class, $member = null)
    {
        $allowedRelations = [];
        $obj = singleton($class);
        $relations = (array)$obj->hasOne() + (array)$obj->hasMany() + (array)$obj->manyMany();
        if ($relations) {
            foreach ($relations as $relName => $relClass) {
                $relClass = static::parseRelationClass($relClass);

                //remove dot notation from relation names
                $parts = explode('.', $relClass);
                $relClass = array_shift($parts);
                if (Config::inst()->get($relClass, 'api_access')) {
                    $allowedRelations[] = $relName;
                }
            }
        }
        return $allowedRelations;
    }
860407
protected function getBinding($class)
    {
        if ($this->isCollection($class) && ! $class->isEmpty()) {
            return $this->getBindingFromCollection($class);
        }

        $class = is_object($class) ? get_class($class) : $class;

        if (! $this->hasBinding($class)) {
            throw new RuntimeException('Unable to find bound transformer for "'.$class.'" class.');
        }

        return $this->bindings[$class];
    }
539814
public function getAttributeKeys($class = null) {
		foreach($this as $key => $data) {
			if($class) {
				if($data instanceof $class)
					$ret[] = $key;
			} else {
				$ret[] = $key;
			}
		}
		return $ret;
	}
1259355
final public static function getImplementation($class) {
        if (!is_a($class, __CLASS__, $allowString=true)) {
            if (!is_class($class)) throw new ClassNotFoundException('Class not found: '.$class );
            throw new InvalidArgumentException('Not a '.__CLASS__.' subclass: '.$class);
        }
        /** @var self $dao */
        $dao = self::getInstance($class);
        return $dao;
    }
927032
public function getByType($class)
    {
        $class = array_map('strtolower', (array)$class);

        $out = array_filter($this->_items, function ($assoc) use ($class) {
            list(, $name) = namespaceSplit(get_class($assoc));

            return in_array(strtolower($name), $class, true);
        });

        return array_values($out);
    }
1038970
public static function getByClass( $class )
	{
		$results = [];
		foreach ( static::$globals as $k => $v )
			if ( $v instanceof $class )
				$results[$k] = $v;
		return $results;
	}
904158
public function getClass(string $class){
        if(!class_exists($class)){
            throw new \InvalidArgumentException();
        }

        if(!array_key_exists($class, $this->classes)){
            $this->classes[$class]  = new \ReflectionClass($class);
        }

        return $this->classes[$class];
    }