mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-12 09:39:28 +00:00
c26bb98960
- autocomplete and dropdown field for search oes and search functions with active and non active entries - possibility to dynamic styling of display switch, newButton in Tabulator, different editLabels - possibility to show/hide column company - possibility to show/hide to save function as copy
37 lines
807 B
PHP
37 lines
807 B
PHP
<?php
|
|
class Funktion_model extends DB_Model
|
|
{
|
|
|
|
/**
|
|
* Constructor
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->dbTable = 'public.tbl_funktion';
|
|
$this->pk = 'funktion_kurzbz';
|
|
}
|
|
|
|
/**
|
|
* Get Functions by eventQuery string. Use with autocomplete event queries in Function Component
|
|
* @param $eventQuery String
|
|
* @return array
|
|
*/
|
|
public function getAutocompleteSuggestions($eventQuery)
|
|
{
|
|
$this->addSelect('funktion_kurzbz, beschreibung, aktiv');
|
|
$this->addSelect("beschreibung AS label");
|
|
$this->addOrder('beschreibung', 'ASC');
|
|
|
|
if($eventQuery === null)
|
|
{
|
|
return $this->load();
|
|
}
|
|
|
|
return $this->loadWhere("
|
|
funktion_kurzbz ILIKE '%". $this->escapeLike($eventQuery). "%'
|
|
OR beschreibung ILIKE '%". $this->escapeLike($eventQuery). "%'
|
|
");
|
|
}
|
|
}
|