lastError() public méthode

Check if there was an error on the most recent db operation performed
public lastError ( ) : array
Résultat array Returns the error, if there was one.
 public function testForceError() {
     $this->object->forceError();
     $err = $this->object->lastError();
     $this->assertNotNull($err['err']);
     $this->assertEquals($err['n'], 0);
     $this->assertEquals((bool)$err['ok'], true);
 }
Exemple #2
0
 /**
  * Wrapper method for MongoDB::lastError().
  *
  * @see http://php.net/manual/en/mongodb.lasterror.php
  * @return array
  */
 public function lastError()
 {
     return $this->mongoDB->lastError();
 }
Exemple #3
0
 public function lastError()
 {
     return $this->_connected ? $this->_db->lastError() : NULL;
 }