MediaWiki
REL1_41
QueryStatus.php
Go to the documentation of this file.
1
<?php
20
namespace
Wikimedia\Rdbms
;
21
26
class
QueryStatus
{
28
public
$res
;
30
public
$rowsReturned
;
32
public
$rowsAffected
;
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
}
Wikimedia\Rdbms\DBUnexpectedError
Definition
DBUnexpectedError.php:27
Wikimedia\Rdbms\QueryStatus
Definition
QueryStatus.php:26
Wikimedia\Rdbms\QueryStatus\$flags
int $flags
Error flag bit field of Database::ERR_* constants.
Definition
QueryStatus.php:38
Wikimedia\Rdbms\QueryStatus\$res
ResultWrapper bool null $res
Result set.
Definition
QueryStatus.php:28
Wikimedia\Rdbms\QueryStatus\$rowsReturned
int $rowsReturned
Returned row count.
Definition
QueryStatus.php:30
Wikimedia\Rdbms\QueryStatus\$rowsAffected
int $rowsAffected
Affected row count.
Definition
QueryStatus.php:32
Wikimedia\Rdbms\QueryStatus\$code
int string $code
Error code or zero.
Definition
QueryStatus.php:36
Wikimedia\Rdbms\QueryStatus\$message
string $message
Error message or empty string.
Definition
QueryStatus.php:34
Wikimedia\Rdbms\QueryStatus\__construct
__construct( $res, int $affected, string $error, $errno)
Definition
QueryStatus.php:48
Wikimedia\Rdbms\ResultWrapper
Result wrapper for grabbing data queried from an IDatabase object.
Definition
ResultWrapper.php:23
Wikimedia\Rdbms\ResultWrapper\numRows
numRows()
Get the number of rows in a result object.
Definition
ResultWrapper.php:94
Wikimedia\Rdbms\IResultWrapper
Result wrapper for grabbing data queried from an IDatabase object.
Definition
IResultWrapper.php:26
Wikimedia\Rdbms
Definition
ChronologyProtector.php:20
includes
libs
rdbms
database
utils
QueryStatus.php
Generated on Sat Nov 23 2024 08:23:52 for MediaWiki by
1.10.0