show title of Characters whereever their names appear

This commit is contained in:
oliver 2016-03-26 18:40:45 +01:00
commit 56bcf81b4b
9 changed files with 98 additions and 9 deletions

View file

@ -31,7 +31,7 @@
*
* @var array
*/
public $models = array('seminaries', 'characters', 'characterroles', 'xplevels', 'avatars', 'achievements');
public $models = array('seminaries', 'characters', 'characterroles', 'xplevels', 'avatars', 'achievements', 'charactertitles');
/**
* Current Seminary
*
@ -91,6 +91,11 @@
catch(\nre\exceptions\IdNotFoundException $e) {
// No Avatar available
}
if(!is_null(self::$character['charactertitle_id']) && !is_null(self::$character['gender']))
{
$title = $this->Charactertitles->getTitleById(self::$character['charactertitle_id']);
self::$character['title'] = $title[(self::$character['gender']) ? 'title_male' : 'title_female'];
}
}
}
catch(\nre\exceptions\IdNotFoundException $e) {