Xpressengine\Database\DatabaseCoupler::connect PHP Method

connect() public method

> $name 은 config/database.php 에 설정 된 이름이며 config/xe.php database 에서 참조됨.
public connect ( null | string $connectionName = null ) : Connection
$connectionName null | string database name
return Illuminate\Database\Connection
    public function connect($connectionName = null)
    {
        if ($connectionName === 'default') {
            $connectionName = null;
        }
        $connection = $this->databaseManager->connection($connectionName);
        $this->transaction->setCurrent($connection);
        return $connection;
    }

Usage Example

コード例 #1
0
 /**
  * get connection
  *
  * @param string $type master or slave
  * @return \Illuminate\Database\Connection
  */
 public function connection($type = self::DEFAULT_CONNECTION_NAME)
 {
     $connection = $this->connections[$type] === null ? $this->coupler->connect($this->{$type}) : $this->connections[$type];
     $connection->setFetchMode($this->fetchMode);
     return $connection;
 }
All Usage Examples Of Xpressengine\Database\DatabaseCoupler::connect