MediaWiki master
QueryStatus.php
Go to the documentation of this file.
1<?php
20namespace Wikimedia\Rdbms;
21
28 public $res;
34 public $message;
36 public $code;
38 public $flags;
39
48 public function __construct( $res, int $affected, string $error, $errno ) {
49 if ( !( $res instanceof IResultWrapper ) && !is_bool( $res ) && $res !== null ) {
50 throw new DBUnexpectedError(
51 null,
52 'Got ' . gettype( $res ) . ' instead of IResultWrapper|bool'
53 );
54 }
55
56 $this->res = $res;
57 $this->rowsReturned = ( $res instanceof IResultWrapper ) ? $res->numRows() : 0;
58 $this->rowsAffected = $affected;
59 $this->message = $error;
60 $this->code = $errno;
61 $this->flags = 0;
62 }
63}
int $flags
Error flag bit field of Database::ERR_* constants.
ResultWrapper bool null $res
Result set.
int $rowsReturned
Returned row count.
int $rowsAffected
Affected row count.
int string $code
Error code or zero.
string $message
Error message or empty string.
__construct( $res, int $affected, string $error, $errno)
Result wrapper for grabbing data queried from an IDatabase object.
numRows()
Get the number of rows in a result object.
Result wrapper for grabbing data queried from an IDatabase object.