MediaWiki  master
DBExpectedError.php
Go to the documentation of this file.
1 <?php
21 namespace Wikimedia\Rdbms;
22 
24 
34 class 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 
64 class_alias( DBExpectedError::class, 'DBExpectedError' );
Wikimedia\Rdbms\DBError\$db
IDatabase null $db
Definition: DBError.php:34
MessageSpecifier
Stable for implementing.
Definition: MessageSpecifier.php:24
Wikimedia\Rdbms
Definition: ChronologyProtector.php:24
Wikimedia\Rdbms\DBError
Database error base class @newable Stable to extend.
Definition: DBError.php:32
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:52
Wikimedia\Rdbms\DBExpectedError
Base class for the more common types of database errors.
Definition: DBExpectedError.php:34
Wikimedia\Rdbms\DBExpectedError\__construct
__construct(?IDatabase $db, $error, array $params=[], \Throwable $prev=null)
Stable to call.
Definition: DBExpectedError.php:45
Wikimedia\Rdbms\DBExpectedError\$params
string[] $params
Message parameters.
Definition: DBExpectedError.php:36
Wikimedia\Rdbms\DBExpectedError\getParams
getParams()
Returns the message parameters.
Definition: DBExpectedError.php:56