public function connection($name = null) { if (is_null($name)) { $name = $this->getDefaultConnection(); } return $this->connections[$name]; }