38        $this->db = 
$DIC->database();
 
   53        $this->glo_id = $a_val;
 
   73        $this->terms = $a_val;
 
   93        if (!in_array($a_term_id, $this->terms)) {
 
   94            $this->terms[] = $a_term_id;
 
  105        foreach ($this->terms as $k => $v) {
 
  106            if ($v == $a_term_id) {
 
  107                unset($this->terms[$k]);
 
  118        $set = $this->db->query(
"SELECT term_id FROM glo_term_reference " .
 
  119            " WHERE glo_id = " . $this->db->quote($this->getGlossaryId(), 
"integer"));
 
  120        while ($rec = $this->db->fetchAssoc($set)) {
 
  121            $this->
addTerm($rec[
"term_id"]);
 
  133                "glo_term_reference",
 
  136                    "term_id" => array(
"integer", 
$t),
 
  146    public function delete()
 
  148        $this->db->manipulate(
 
  149            "DELETE FROM glo_term_reference WHERE " .
 
  150            " glo_id = " . $this->db->quote($this->getGlossaryId(), 
"integer")
 
  165            "DELETE FROM glo_term_reference WHERE " .
 
  166            " term_id = " . 
$db->quote($a_term_id, 
"integer")
 
  183            "SELECT * FROM glo_term_reference  " .
 
  184            " WHERE glo_id = " . 
$db->quote($a_glossary_id, 
"integer")
 
  186        if ($rec = 
$db->fetchAssoc($set)) {
 
  203        if (!is_array($a_glo_id)) {
 
  204            $a_glo_id = array($a_glo_id);
 
  207            $q = 
"SELECT * FROM glo_term_reference " .
 
  208            " WHERE " . 
$db->in(
"glo_id", $a_glo_id, 
false, 
"integer") .
 
  209            " AND term_id = " . 
$db->quote($a_term_id, 
"integer")
 
  211        if ($rec = 
$db->fetchAssoc($set)) {
 
  229            $q = 
"SELECT DISTINCT glo_id FROM glo_term_reference " .
 
  230            " WHERE term_id = " . 
$db->quote($a_term_id, 
"integer")
 
  233        while ($rec = 
$db->fetchAssoc($set)) {
 
  234            $glos[] = $rec[
"glo_id"];
 
An exception for terminatinating execution or to throw for unit testing.
static hasReferences($a_glossary_id)
Check if a glossary uses references.
setTerms($a_val)
Set terms.
setGlossaryId($a_val)
Set glossary id.
getGlossaryId()
Get glossary id.
__construct($a_glo_id=0)
__construct
static lookupReferencesOfTerm($a_term_id)
Lookup references of a term.
deleteTerm($a_term_id)
Delete term.
addTerm($a_term_id)
Add term.
static deleteReferencesOfTerm($a_term_id)
Delete all references of a term.
static isReferenced($a_glo_id, $a_term_id)
Is a term referenced by one or multiple glossaries.