MediaWiki REL1_28
DBExpectedError Class Reference

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

Inheritance diagram for DBExpectedError:
Collaboration diagram for DBExpectedError:

Public Member Functions

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

Protected Attributes

string[] $params
 Message parameters.
 

Additional Inherited Members

- Public Attributes inherited from 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.

Since
1.23

Definition at line 29 of file DBExpectedError.php.

Constructor & Destructor Documentation

◆ __construct()

DBExpectedError::__construct ( IDatabase  $db = null,
  $error,
array  $params = [] 
)

Definition at line 33 of file DBExpectedError.php.

References DBError\$db, and $params.

Member Function Documentation

◆ getKey()

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.

Returns
string

Implements MessageSpecifier.

Reimplemented in DBTransactionSizeError.

Definition at line 38 of file DBExpectedError.php.

◆ getParams()

DBExpectedError::getParams ( )

Returns the message parameters.

Returns
array

Implements MessageSpecifier.

Definition at line 42 of file DBExpectedError.php.

References $params.

Member Data Documentation

◆ $params

string [] DBExpectedError::$params
protected

Message parameters.

Definition at line 31 of file DBExpectedError.php.

Referenced by __construct(), and getParams().


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