/** * Returns the connection. * * @access protected * @return \mako\database\Connection */ protected function getConnection() { if (empty($this->connectionName)) { return $this->connectionManager->connection(); } return $this->connectionManager->connection($this->connectionName); }
/** * Returns the connection of the model. * * @access public * @return \mako\database\connections\Connection */ public function getConnection() { if (empty(static::$connectionManager)) { static::$connectionManager = Application::instance()->getContainer()->get('database'); } return static::$connectionManager->connection($this->connectionName); }
/** * Returns the database connection. * * @access protected * @return \mako\database\Connection */ protected function connection() { return $this->database->connection(); }