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 = [], \Throwable $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' );
Wikimedia\Rdbms\DBError\$db
IDatabase null $db
Definition: DBError.php:32
MessageSpecifier
Definition: MessageSpecifier.php:21
Wikimedia\Rdbms
Definition: ChronologyProtector.php:24
Wikimedia\Rdbms\DBError
Database error base class.
Definition: DBError.php:30
Wikimedia\Rdbms\IDatabase
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:38
Wikimedia\Rdbms\DBExpectedError\getKey
getKey()
Returns the message key.
Definition: DBExpectedError.php:49
Wikimedia\Rdbms\DBExpectedError
Base class for the more common types of database errors.
Definition: DBExpectedError.php:32
Wikimedia\Rdbms\DBExpectedError\__construct
__construct(?IDatabase $db, $error, array $params=[], \Throwable $prev=null)
Definition: DBExpectedError.php:42
Wikimedia\Rdbms\DBExpectedError\$params
string[] $params
Message parameters.
Definition: DBExpectedError.php:34
Wikimedia\Rdbms\DBExpectedError\getParams
getParams()
Returns the message parameters.
Definition: DBExpectedError.php:53