QL\QueryList::getInstance PHP Method

getInstance() public static method

获取任意实例
public static getInstance ( ) : mixed
return mixed
    public static function getInstance()
    {
        $args = func_get_args();
        count($args) || ($args = array('QL\\QueryList'));
        $key = md5(serialize($args));
        $className = array_shift($args);
        if (!class_exists($className)) {
            throw new Exception("no class {$className}");
        }
        if (!isset(self::$instances[$key])) {
            $rc = new ReflectionClass($className);
            self::$instances[$key] = $rc->newInstanceArgs($args);
        }
        return self::$instances[$key];
    }