MediaWiki REL1_35
DBExpectedError.php
Go to the documentation of this file.
1<?php
21namespace Wikimedia\Rdbms;
22
24
34class DBExpectedError extends DBError implements MessageSpecifier {
36 protected $params;
37
45 public function __construct(
46 ?IDatabase $db, $error, array $params = [], \Throwable $prev = null
47 ) {
48 parent::__construct( $db, $error, $prev );
49 $this->params = $params;
50 }
51
52 public function getKey() {
53 return 'databaseerror-text';
54 }
55
56 public function getParams() {
57 return $this->params;
58 }
59}
60
64class_alias( DBExpectedError::class, 'DBExpectedError' );
Database error base class @newable Stable to extend.
Definition DBError.php:32
IDatabase null $db
Definition DBError.php:34
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)
Stable to call.
Stable for implementing.
Basic database interface for live and lazy-loaded relation database handles.
Definition IDatabase.php:38