/** * 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; }