mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 08:34:29 +00:00
- Added method loadPhrases to FHC_Conroller as a wrapper to load phrases
- Added method getLanguage to Person_model to load the language for a user by the given UID - Added comments to method getPhrasesByCategoryAndLanguage of system/Phrase_model, ORDER BY and more fields to SQL statement
This commit is contained in:
@@ -62,15 +62,18 @@ class Phrase_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Loads phrases using category(s) and language as keys
|
||||
* The retrived fields are category, phrase, orgeinheit_kurzbz, orgform_kurzbz and text
|
||||
* They are ordered by p.category, p.phrase, pt.orgeinheit_kurzbz DESC and pt.orgform_kurzbz DESC'
|
||||
*/
|
||||
public function getPhrasesByCategoryAndLanguage($categories, $language)
|
||||
{
|
||||
$query = 'SELECT p.category, p.phrase, pt.text
|
||||
$query = 'SELECT p.category, p.phrase, pt.orgeinheit_kurzbz, pt.orgform_kurzbz, pt.text
|
||||
FROM system.tbl_phrase p
|
||||
INNER JOIN system.tbl_phrasentext pt USING(phrase_id)
|
||||
WHERE p.category IN ?
|
||||
AND pt.sprache = ?';
|
||||
AND pt.sprache = ?
|
||||
ORDER BY p.category, p.phrase, pt.orgeinheit_kurzbz DESC, pt.orgform_kurzbz DESC';
|
||||
|
||||
return $this->execQuery($query, array($categories, $language));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user