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