Files
FHC-Core/application/models/system/Vorlagedokument_model.php
T
bison-paolo 8e0ca12deb - All permission functionalities now are in the library PermissionLib
- All return messages functions are in the message helper and it is loaded by the core classes
- Added the missing constant FHC_NOPK
- Updated all the interested classes with the new permission method
- Updated all the interested classes with the new return message functions
2016-10-13 17:53:12 +02:00

43 lines
1.0 KiB
PHP

<?php
class Vorlagedokument_model extends DB_Model
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->dbTable = 'public.tbl_vorlagedokument';
$this->pk = 'vorlagedokument_id';
}
/**
*
*/
public function loadDokumenteFromVorlagestudiengang($vorlagestudiengang_id)
{
// Checks if the operation is permitted by the API caller
if (($chkRights = $this->isEntitled('public.tbl_vorlagedokument', PermissionLib::SELECT_RIGHT, FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
return $chkRights;
$result = null;
$qry = 'SELECT vorlagedokument_id,
sort,
vorlagestudiengang_id,
dokument_kurzbz,
bezeichnung
FROM public.tbl_vorlagedokument
JOIN public.tbl_dokument USING(dokument_kurzbz)
WHERE vorlagestudiengang_id = ?
ORDER BY sort ASC';
$result = $this->db->query($qry, array($vorlagestudiengang_id));
if (is_object($result))
return success($result->result());
else
return error($this->db->error(), FHC_DB_ERROR);
}
}