- 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:
Paolo
2018-04-17 16:00:19 +02:00
parent 794fb7f6ac
commit 08c5733298
4 changed files with 66 additions and 15 deletions
@@ -22,20 +22,22 @@ class Phrase extends APIv1_Controller
public function __construct()
{
parent::__construct();
// Loads the phrases library
$this->load->library('PhrasesLib');
}
/**
* @return void
*
*/
public function getPhrase()
{
$phrase_id = $this->get('phrase_id');
if (isset($phrase_id))
{
$result = $this->phraseslib->getPhrase($phrase_id);
$this->response($result, REST_Controller::HTTP_OK);
}
else
@@ -43,9 +45,9 @@ class Phrase extends APIv1_Controller
$this->response();
}
}
/**
* @return void
*
*/
public function getPhrases()
{
@@ -55,11 +57,11 @@ class Phrase extends APIv1_Controller
$orgeinheit_kurzbz = $this->get('orgeinheit_kurzbz');
$orgform_kurzbz = $this->get('orgform_kurzbz');
$blockTags = $this->get('blockTags');
if (isset($app) && isset($sprache))
{
$result = $this->phraseslib->getPhrases($app, $sprache, $phrase, $orgeinheit_kurzbz, $orgform_kurzbz, $blockTags);
$this->response($result, REST_Controller::HTTP_OK);
}
else
@@ -69,7 +71,7 @@ class Phrase extends APIv1_Controller
}
/**
* @return void
*
*/
public function postPhrase()
{
@@ -83,7 +85,7 @@ class Phrase extends APIv1_Controller
{
$result = $this->PhraseModel->insert($this->post());
}
$this->response($result, REST_Controller::HTTP_OK);
}
else
@@ -91,9 +93,12 @@ class Phrase extends APIv1_Controller
$this->response();
}
}
/**
*
*/
private function _validate($phrase = null)
{
return false;
}
}
}