Added getAutocompleteSuggestions method to OE Model

Get OEs by eventQuery string. Use with autocomplete event queries.
This commit is contained in:
Cris
2023-09-21 14:40:05 +02:00
parent e1c23fc6fa
commit fa3a718ad4
@@ -188,4 +188,20 @@ class Organisationseinheit_model extends DB_Model
}
return $this->loadWhere($condition);
}
/**
* Get OEs by eventQuery string. Use with autocomplete event queries.
* @param $eventQuery String
* @return array
*/
public function getAutocompleteSuggestions($eventQuery)
{
$this->addSelect('oe_kurzbz');
$this->addSelect('organisationseinheittyp_kurzbz, oe_kurzbz, bezeichnung, aktiv, lehre');
$this->addOrder('organisationseinheittyp_kurzbz, bezeichnung');
return $this->loadWhere("
oe_kurzbz ILIKE '%". $this->escapeLike($eventQuery). "%'
");
}
}