MediaWiki  master
DBExpectedError.php
Go to the documentation of this file.
1 <?php
20 namespace Wikimedia\Rdbms;
21 
23 
33 class DBExpectedError extends DBError implements MessageSpecifier {
35  protected $params;
36 
44  public function __construct(
45  ?IDatabase $db, $error, array $params = [], \Throwable $prev = null
46  ) {
47  parent::__construct( $db, $error, $prev );
48  $this->params = $params;
49  }
50 
51  public function getKey() {
52  return 'databaseerror-text';
53  }
54 
55  public function getParams() {
56  return $this->params;
57  }
58 }
59 
63 class_alias( DBExpectedError::class, 'DBExpectedError' );
Database error base class.
Definition: DBError.php:31
IDatabase null $db
Definition: DBError.php:33
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)
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:40