Replace \ORM::forTable. Also work with multi-connections
@param null $name
@return \ORM
541795
public static function forTable($name=null, $connName = \ORM::DEFAULT_CONNECTION)
    {
        return \ORM::forTable(\ORM::getConfig('tablePrefix', $connName) . $name, $connName);
    }
947720
public static function fromQName( $name )
	{
		if ( $name instanceof QName )
		{
			$name = "{$name->prefix}:{$name->localName}";
		}
		if ( ! is_string( $name ) )
		{
			throw new \InvalidArgumentException( "$name must be string or a QName instanxe" );
		}

		$types = SchemaTypes::getInstance();
		$attribute = $types->getElement( $name );

		if ( ! $attribute )
		{
			return null;
		}

		$result = new DOMSchemaAttribute();
		error_log( __CLASS__ . " need to populate the DOMSchemaAttribute instance" );
		return $result;
	}
787148
public function withName(string $name) : Column
    {
        if ($this->name === $name) {
            return $this;
        }

        return new self($name, $this->type, $this->isPrimaryKey);
    }
1195952
public function &load(string $name) : ModularAbstract
    {
        $modular =& $this->internalGetModular($name);
        if (!$this->hasLoaded($name)) {
            $modular->init();
            $this->loadedModular[$this->sanitizeModularName($name)] = true;
        }

        return $modular;
    }
859211
public static function connection($name)
    {
        $schema = static::$app['db']->connection($name)->getSchemaBuilder();
        $schema->blueprintResolver(function ($table, $callback) {
            return new Blueprint($table, $callback);
        });

        return $schema;
    }
1325231
public function create(Name $name)
    {
        $factory = $this->factoryMap->hasFactory($name)
            ? $this->factoryMap->getFactory($name)
            : $this->defaultTransactionFactory;

        return new IsolateContext($name, $factory);
    }
1365529
public function reconnect($name = null)
    {
        $name = $name ?: $this->default;

        $this->disconnect($name);

        return $this->connection($name);
    }
190938
public static function get($name = null)
    {
        if ($name === null) {
            $name = array_shift(array_keys(self::$containers));
        }
        return self::$containers[$name] ? self::$containers[$name] : null;
    }
189421
public static function defaultTo($name){
    if (isset(self::$connections[$name])){
      self::$current = $name;
      return true;
    } else return false;
  }
290683
public function column($name)
    {
        $column = new ColumnSchema($this, $name);
        $this->columns[$name] = $column;
        return $column;
    }
752938
private function isNullable($name)
    {
        //TODO: need update after updating isNullable method of Doctrine\ORM\Mapping\ClassMetadata
        if ($this->metadata->hasField($name)) {
            return method_exists($this->metadata, 'isNullable') && $this->metadata->isNullable($name);
        } else if ($this->metadata->hasAssociation($name) && method_exists($this->metadata, 'getAssociationMapping')) {
            $mapping = $this->metadata->getAssociationMapping($name);

            return false !== $mapping && isset($mapping['nullable']) && $mapping['nullable'];
        }

        return false;
    }
817812
private static function db(string $name = null) : TransactionDatabase
    {
        list($container, $config, $return) = DI::detect(__METHOD__, 'db', $name);

        if ($return) {
            return $return;
        }

        if (is_string($config)) {
            $key = 'instance_' . md5($config);
        } else {
            $key = 'instance_' . md5(serialize($config));
        }

        if (DI::get(__METHOD__, $key)) {
            return DI::get(__METHOD__, $key);
        }

        $db = AbstractDatabase::create($config);
        DI::set(__METHOD__, $key, $db);

        return DI::set(__METHOD__, $container, $db);
    }
59340
static public function db($name=null)
	{
	    $id = 'db' . ($name ? '.' . $name : '');
	    if (!static::has($id)) {
	        static::setShared($id, function () use($name) {
	            Config::load('database');
	            $config = (array)Config::get('database');
	            if ($config) {
	                $config = ArrayHelper::getItemArray($config, $name);
	            }
	            
	            return new Db($config);
	        });
	    }
	    
	    return static::get($id);
	}
323753
public function param($name)
    {
        $params = $this->params();
        if (isset($params[$name])) {
            return $params[$name];
        } else {
            return null;
        }
    }
315092
private static function queue(string $name = null) : Queue
    {
        list($container, $config, $return) = DI::detect(__METHOD__, 'queue', $name);

        if ($return) {
            return $return;
        }

        $db = new Queue($config);

        return DI::set(__METHOD__, $container, $db);
    }
937621
public function getConnection($name = null)
    {
        if (null === $name) {
            $name = $this->defaultConnection;
        }

        if (!isset($this->connections[$name])) {
            throw new \InvalidArgumentException(sprintf('AMQP Connection named "%s" does not exist.', $name));
        }

        return $this->connections[$name];
    }
391575
public static function connection($name = null)
    {
        if (is_null($name) || strlen($name) == 0) {
            if (is_null(static::$name)) {
                static::$name = static::$config['default'];
            }

            $name = static::$name;
        }

        if (!isset(static::$config['connection'][$name])) {
            throw new ConnectionException('The connection "' . $name . '" is not defined.');
        }

        if ($name !== static::$name) {
            static::$adapter = null;
        }

        $config = static::$config['connection'][$name];

        static::$name = $name;

        if (static::$adapter === null) {
            if ($name == 'mysql') {
                static::$adapter = new MysqlAdapter($config);
            } elseif ($name == 'sqlite') {
                static::$adapter = new SqliteAdapter($config);
            } else {
                throw new ConnectionException('This driver is not praised');
            }

            static::$adapter->setFetchMode(static::$config['fetch']);
        }

        if (static::$adapter->getConnection() instanceof PDO && $name == static::$name) {
            return static::getInstance();
        }

        return static::getInstance();
    }