MediaWiki REL1_30
DBExpectedError.php
Go to the documentation of this file.
1<?php
22namespace Wikimedia\Rdbms;
23
26use Message;
27
37 protected $params;
38
39 public function __construct( IDatabase $db = null, $error, array $params = [] ) {
40 parent::__construct( $db, $error );
41 $this->params = $params;
42 }
43
44 public function getKey() {
45 return 'databaseerror-text';
46 }
47
48 public function getParams() {
49 return $this->params;
50 }
51
56 public function getMessageObject() {
57 return Message::newFromSpecifier( $this );
58 }
59}
60
61class_alias( DBExpectedError::class, 'DBExpectedError' );
The Message class provides methods which fulfil two basic services:
Definition Message.php:159
Database error base class.
Definition DBError.php:30
IDatabase null $db
Definition DBError.php:32
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=null, $error, array $params=[])
Interface for MediaWiki-localized exceptions.
Basic database interface for live and lazy-loaded relation database handles.
Definition IDatabase.php:40