MediaWiki  master
DBExpectedError.php
Go to the documentation of this file.
1 <?php
21 namespace Wikimedia\Rdbms;
22 
24 
32 class DBExpectedError extends DBError implements MessageSpecifier {
34  protected $params;
35 
42  public function __construct(
43  ?IDatabase $db, $error, array $params = [], $prev = null
44  ) {
45  parent::__construct( $db, $error, $prev );
46  $this->params = $params;
47  }
48 
49  public function getKey() {
50  return 'databaseerror-text';
51  }
52 
53  public function getParams() {
54  return $this->params;
55  }
56 }
57 
61 class_alias( DBExpectedError::class, 'DBExpectedError' );
IDatabase null $db
Definition: DBError.php:32
__construct(?IDatabase $db, $error, array $params=[], $prev=null)
getParams()
Returns the message parameters.
string [] $params
Message parameters.
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:38
getKey()
Returns the message key.
Database error base class.
Definition: DBError.php:30
Base class for the more common types of database errors.