From f6bb14569b0a777d3511b732201af9d1a415f2ed Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Fri, 15 Feb 2013 22:19:24 -0600 Subject: [feature/migrations] getLocalisedMessage function for migration exception PHPBB3-11351 --- phpBB/includes/db/migration/exception.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/phpBB/includes/db/migration/exception.php b/phpBB/includes/db/migration/exception.php index b3abcdb5e5..e84330dd71 100644 --- a/phpBB/includes/db/migration/exception.php +++ b/phpBB/includes/db/migration/exception.php @@ -62,4 +62,18 @@ class phpbb_db_migration_exception extends \Exception { 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); + } } -- cgit v1.2.1