示例#1
0
 /**
  * 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);
 }
示例#2
0
 /**
  * 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);
 }
示例#3
0
 /**
  * Returns the database connection.
  *
  * @access  protected
  * @return  \mako\database\Connection
  */
 protected function connection()
 {
     return $this->database->connection();
 }