mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 01:42:17 +00:00
f3b79cd731
- Added method toPhp to DB_Model to convert array and boolean types from PostgresSQL to php - Added method execQuery to DB_Model to execute a query (it calls toPhp) - Added method pgsqlArrayToPhpArray to convert a pgsql array to php - Updated DB_Model methods to using chkRights (and toPhp where it is needed) - Removed methods escapeArray and _pgsqlArrayToPhpArray from controller APIv1_Controller - Removed escapeArray from controllers Dokumentstudiengang and Dokument - Updated models to use execQuery (and chkRights where it is needed)
35 lines
773 B
PHP
35 lines
773 B
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 rights
|
|
if ($chkRights = $this->chkRights(PermissionLib::SELECT_RIGHT)) return $chkRights;
|
|
|
|
$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';
|
|
|
|
return $this->execQuery($qry, array($vorlagestudiengang_id));
|
|
}
|
|
} |