MediaWiki  1.33.0
Wikimedia\Rdbms\DBExpectedError Class Reference

Base class for the more common types of database errors. More...

Inheritance diagram for Wikimedia\Rdbms\DBExpectedError:
Collaboration diagram for Wikimedia\Rdbms\DBExpectedError:

Public Member Functions

 __construct (IDatabase $db=null, $error, array $params=[], $prev=null)
 getKey ()
 Returns the message key. More...
 getParams ()
 Returns the message parameters. More...
- Public Member Functions inherited from Wikimedia\Rdbms\DBError
 __construct (IDatabase $db=null, $error, $prev=null)
 Construct a database error. More...

Protected Attributes

string[] $params
 Message parameters. More...

Additional Inherited Members

- Public Attributes inherited from Wikimedia\Rdbms\DBError
IDatabase null $db

Detailed Description

Base class for the more common types of database errors.

These are known to occur frequently, so we try to give friendly error messages for them.


Definition at line 32 of file DBExpectedError.php.

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Rdbms\DBExpectedError::__construct ( IDatabase  $db = null,
array  $params = [],
  $prev = null 
IDatabase | null$db
\\Exception | \\Throwable | null$prev

Definition at line 42 of file DBExpectedError.php.

References Wikimedia\Rdbms\DBError\$db, and Wikimedia\Rdbms\DBExpectedError\$params.

Member Function Documentation

◆ getKey()

Wikimedia\Rdbms\DBExpectedError::getKey ( )

Returns the message key.

If a list of multiple possible keys was supplied to the constructor, this method may return any of these keys. After the message has been fetched, this method will return the key that was actually used to fetch the message.


Implements MessageSpecifier.

Reimplemented in Wikimedia\Rdbms\DBTransactionSizeError.

Definition at line 49 of file DBExpectedError.php.

◆ getParams()

Wikimedia\Rdbms\DBExpectedError::getParams ( )

Returns the message parameters.


Implements MessageSpecifier.

Definition at line 53 of file DBExpectedError.php.

References Wikimedia\Rdbms\DBExpectedError\$params.

Member Data Documentation

◆ $params

string [] Wikimedia\Rdbms\DBExpectedError::$params

Message parameters.

Definition at line 34 of file DBExpectedError.php.

Referenced by Wikimedia\Rdbms\DBExpectedError\__construct(), and Wikimedia\Rdbms\DBExpectedError\getParams().

The documentation for this class was generated from the following file: