MediaWiki master
QueryStatus.php
Go to the documentation of this file.
1<?php
6namespace Wikimedia\Rdbms;
7
14 public $res;
20 public $message;
22 public $code;
24 public $flags;
25
34 public function __construct( $res, int $affected, string $error, $errno ) {
35 if ( !( $res instanceof IResultWrapper ) && !is_bool( $res ) && $res !== null ) {
36 throw new DBUnexpectedError(
37 null,
38 'Got ' . get_debug_type( $res ) . ' instead of IResultWrapper|bool'
39 );
40 }
41
42 $this->res = $res;
43 $this->rowsReturned = ( $res instanceof IResultWrapper ) ? $res->numRows() : 0;
44 $this->rowsAffected = $affected;
45 $this->message = $error;
46 $this->code = $errno;
47 $this->flags = 0;
48 }
49}
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.int
Result wrapper for grabbing data queried from an IDatabase object.