prevError() 공개 메소드

Checks for the last error thrown during a database operation
public prevError ( ) : array
리턴 array Returns the error and the number of operations ago it occurred.
예제 #1
0
 public function testPrevError()
 {
     $this->object->resetError();
     $err = $this->object->prevError();
     $this->assertEquals($err['err'], null);
     $this->assertEquals($err['n'], 0);
     $this->assertEquals($err['nPrev'], -1);
     $this->assertEquals($err['ok'], 1);
     $this->object->forceError();
     $err = $this->object->prevError();
     $this->assertNotNull($err['err']);
     $this->assertEquals($err['n'], 0);
     $this->assertEquals($err['nPrev'], 1);
     $this->assertEquals($err['ok'], 1);
 }
예제 #2
0
 /**
  * Wrapper method for MongoDB::prevError().
  *
  * @deprecated 1.1 Deprecated in driver; will be removed for 1.2
  * @see http://php.net/manual/en/mongodb.preverror.php
  * @return array
  */
 public function prevError()
 {
     return $this->mongoDB->prevError();
 }
예제 #3
0
 public function prevError()
 {
     return $this->_connected ? $this->_db->prevError() : NULL;
 }