[feature/migrations] getLocalisedMessage function for migration exception

PHPBB3-11351
This commit is contained in:
Nathan Guse 2013-02-15 22:19:24 -06:00
parent f9a1b27a99
commit f6bb14569b

View file

@ -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);
}
}