assign Character titles via QR-codes (implements #118)

This commit is contained in:
oliver 2016-03-26 17:36:23 +01:00
commit eddc4036cf
6 changed files with 101 additions and 3 deletions

View file

@ -69,7 +69,7 @@
public function getTitleByHash($titleHash)
{
$data = $this->db->query(
'SELECT id, hash, title_male, title_female '.
'SELECT id, seminary_id, hash, title_male, title_female '.
'FROM charactertitles '.
'WHERE hash = ?',
's',
@ -123,6 +123,26 @@
}
/**
* Add a Character title to the list of titles for a Character.
*
* @param int $titleId ID of title to assign
* @param int $characterId ID of Character to assign title to
*/
public function assignTitleToCharacter($titleId, $characterId)
{
$this->db->query(
'INSERT IGNORE INTO characters_charactertitles '.
'(character_id, charactertitle_id) '.
'VALUES '.
'(?, ?)',
'ii',
$characterId,
$titleId
);
}
/**
* Check if a title for a Characters already exists.
*