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
Esempio n. 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;
 }
 /**
  * get connection
  *
  * @param string $type master or slave
  * @return \Illuminate\Database\Connection
  */
 public function connection($type)
 {
     $connection = $this->connections[$type] === null ? $this->coupler->connect($this->{$type}) : $this->connections[$type];
     $connection->setFetchMode($this->fetchMode);
     return $connection;
 }