mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-26 00:54:27 +00:00
- Added new library ReihungstestLib
- Added method isEntitled to FCH_Model - Cleaned the controllers by moving the database related code in the models or libraries
This commit is contained in:
@@ -1,14 +1,22 @@
|
||||
<?php
|
||||
|
||||
class Gemeinde_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'bis.tbl_gemeinde';
|
||||
$this->pk = 'gemeinde_id';
|
||||
$this->dbTable = "bis.tbl_gemeinde";
|
||||
$this->pk = "gemeinde_id";
|
||||
}
|
||||
}
|
||||
|
||||
public function getGemeindeByPlz($plz)
|
||||
{
|
||||
$this->addSelect("DISTINCT ON (ortschaftsname) ortschaftsname, gemeinde_id, plz, name, ortschaftskennziffer, bulacode, bulabez, kennziffer");
|
||||
$this->addOrder("ortschaftsname");
|
||||
|
||||
return $this->loadWhere(array("plz" => $plz));
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,37 @@
|
||||
<?php
|
||||
|
||||
class Dokumentstudiengang_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_dokumentstudiengang';
|
||||
$this->pk = array('studiengang_kz', 'dokument_kurzbz');
|
||||
$this->dbTable = "public.tbl_dokumentstudiengang";
|
||||
$this->pk = array("studiengang_kz", "dokument_kurzbz");
|
||||
}
|
||||
}
|
||||
|
||||
public function getDokumentstudiengangByStudiengang_kz($studiengang_kz, $onlinebewerbung, $pflicht)
|
||||
{
|
||||
// Checks if the operation is permitted by the API caller
|
||||
if (($chkRights = $this->isEntitled("public.tbl_dokument", "s", FHC_NORIGHT, FHC_MODEL_ERROR)) !== true)
|
||||
return $chkRights;
|
||||
|
||||
$this->addJoin("public.tbl_dokument", "dokument_kurzbz");
|
||||
|
||||
$parameterArray = array("studiengang_kz" => $studiengang_kz);
|
||||
|
||||
if( isset($onlinebewerbung))
|
||||
{
|
||||
$parameterArray["onlinebewerbung"] = $onlinebewerbung;
|
||||
}
|
||||
|
||||
if( isset($pflicht))
|
||||
{
|
||||
$parameterArray["pflicht"] = $pflicht;
|
||||
}
|
||||
|
||||
return $this->loadWhere($parameterArray);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user