src/Database/Migration/Schema.php
/**
	 * Returns a schema instance for the given connection.
	 *
	 * @param string|null $name
	 * @return SchemaConnection
	 */
Returns a schema instance for the given connection.
@param string|null $name
@return SchemaConnection
Returns a schema instance for the given connection . @param string|null $name @return SchemaConnection
public static function connection($name = null) {
		if ($name === null) {
			if (static::$connection === null) {
				static::$connection = static::connection('main');
			}
			return static::$connection;
		}
		if (array_key_exists($name, static::$connectionCache)) {
			$cached = static::$connectionCache[$name];
			return $cached;
		}
		$cached = static::$connectionCache[$name] = new SchemaConnection(Database::connection($name));
		return $cached;
	}
public static function connection ( $ name = null ) { if ( $ name === null ) { if ( static :: $ connection === null ) { static :: $ connection = static :: connection ( 'main' ) ; } return static :: $ connection ; } if ( array_key_exists ( $ name , static :: $ connectionCache ) ) { $ cached = static :: $ connectionCache [ $ name ] ; return $ cached ; } $ cached = static :: $ connectionCache [ $ name ] = new SchemaConnection ( Database :: connection ( $ name ) ) ; return $ cached ; }
Returns a schema instance for the given connection.
Returns a schema instance for the given connection .