diff options
Diffstat (limited to 'phpBB/includes/db/migration/exception.php')
-rw-r--r-- | phpBB/includes/db/migration/exception.php | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/phpBB/includes/db/migration/exception.php b/phpBB/includes/db/migration/exception.php index ffdcd97780..e84330dd71 100644 --- a/phpBB/includes/db/migration/exception.php +++ b/phpBB/includes/db/migration/exception.php @@ -52,4 +52,28 @@ class phpbb_db_migration_exception extends \Exception { return $this->message . ': ' . var_export($this->parameters, true); } + + /** + * Get the parameters + * + * @return array + */ + public function getParameters() + { + return $this->parameters; + } + + /** + * Get localised message (with $user->lang()) + * + * @param phpbb_user $user + * @return string + */ + public function getLocalisedMessage(phpbb_user $user) + { + $parameters = $this->getParameters(); + array_unshift($parameters, $this->getMessage()); + + return call_user_func_array(array($user, 'lang'), $parameters); + } } |