lithium\data\source\database\adapter\Sqlite3::disconnect PHP Method

disconnect() public method

Disconnects the adapter from the database.
public disconnect ( ) : boolean
return boolean True on success, else false.
    public function disconnect()
    {
        if ($this->_isConnected) {
            unset($this->connection);
            $this->_isConnected = false;
        }
        return true;
    }

Usage Example

Esempio n. 1
0
 /**
  * Tests that this adapter can connect to the database, and that the status is properly
  * persisted.
  *
  * @return void
  */
 public function testDatabaseConnection()
 {
     $db = new Sqlite3(array('autoConnect' => false) + $this->_dbConfig);
     $this->assertTrue($db->connect());
     $this->assertTrue($db->isConnected());
     $this->assertTrue($db->disconnect());
     $this->assertFalse($db->isConnected());
 }