mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
d8cd786079
- application/libraries/* -> CS compliant - FHC_Model isEntitled method now return error() or success() - Updated all code that uses isEntitled method from FHC_Model - Removed Squiz.PHP.DisallowSizeFunctionsInLoops from CS ruleset - Removed depracated method replace from DB_Model - Removed unused method pgArrayPhp from DB_Model - Renamed method arrayMergeIndex to _arrayCombine in DB_Model and set as private - Added method _manageUDFs to DB_Model (a wrapper for UDFLib->manageUDFs)
64 lines
1.5 KiB
PHP
64 lines
1.5 KiB
PHP
<?php
|
|
|
|
class Phrase_model extends DB_Model
|
|
{
|
|
/**
|
|
* Constructor
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->dbTable = 'system.tbl_phrase';
|
|
$this->pk = 'phrase_id';
|
|
}
|
|
|
|
/**
|
|
* getPhrases
|
|
*/
|
|
public function getPhrases($app, $sprache, $phrase = null, $orgeinheit_kurzbz = null, $orgform_kurzbz = null)
|
|
{
|
|
// Checks if the operation is permitted by the API caller
|
|
if (isError($ent = $this->isEntitled('system.tbl_phrase', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
|
return $ent;
|
|
if (isError($ent = $this->isEntitled('system.tbl_phrasentext', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)))
|
|
return $ent;
|
|
|
|
$parametersArray = array('app' => $app, 'sprache' => $sprache);
|
|
|
|
$query = 'SELECT phrase,
|
|
sprache,
|
|
orgeinheit_kurzbz,
|
|
orgform_kurzbz,
|
|
text
|
|
FROM system.tbl_phrase JOIN system.tbl_phrasentext USING (phrase_id)
|
|
WHERE app = ? AND sprache = ?';
|
|
|
|
if (isset($phrase))
|
|
{
|
|
$parametersArray['phrase'] = $phrase;
|
|
|
|
if (is_array($phrase))
|
|
{
|
|
$query .= ' AND phrase IN ?';
|
|
}
|
|
else
|
|
{
|
|
$query .= ' AND phrase = ?';
|
|
}
|
|
}
|
|
|
|
if (isset($orgeinheit_kurzbz))
|
|
{
|
|
$parametersArray['orgeinheit_kurzbz'] = $orgeinheit_kurzbz;
|
|
$query .= ' AND orgeinheit_kurzbz = ?';
|
|
}
|
|
if (isset($orgform_kurzbz))
|
|
{
|
|
$parametersArray['orgform_kurzbz'] = $orgform_kurzbz;
|
|
$query .= ' AND orgform_kurzbz = ?';
|
|
}
|
|
|
|
return $this->execQuery($query, $parametersArray);
|
|
}
|
|
}
|