ILIAS  release_4-4 Revision
ilGlossaryTerm Class Reference

Class ilGlossaryTerm. More...

+ Collaboration diagram for ilGlossaryTerm:

Public Member Functions

 ilGlossaryTerm ($a_id=0)
 Constructor public. More...
 
 read ()
 read glossary term data More...
 
 _getIdForImportId ($a_import_id)
 get current term id for import id (static) More...
 
 _exists ($a_id)
 checks wether a glossary term with specified id exists or not More...
 
 setId ($a_id)
 set glossary term id (= glossary item id) More...
 
 getId ()
 get term id (= glossary item id) More...
 
 setGlossary (&$a_glossary)
 set glossary object More...
 
 setGlossaryId ($a_glo_id)
 set glossary id More...
 
 getGlossaryId ()
 get glossary id More...
 
 setTerm ($a_term)
 set term More...
 
 getTerm ()
 get term More...
 
 setLanguage ($a_language)
 set language More...
 
 getLanguage ()
 get language More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getImportId ()
 get import id More...
 
 create ()
 create new glossary term More...
 
 delete ()
 delete glossary term (and all its definition objects) More...
 
 update ()
 update glossary term More...
 
 _lookGlossaryID ($term_id)
 get glossary id form term id More...
 
 _lookGlossaryTerm ($term_id)
 get glossary term More...
 
 _lookLanguage ($term_id)
 lookup term language More...
 
 exportXML (&$a_xml_writer, $a_inst)
 export xml More...
 
 _copyTerm ($a_term_id, $a_glossary_id)
 Copy a term to a glossary. More...
 

Static Public Member Functions

static getTermList ($a_glo_id, $searchterm="", $a_first_letter="", $a_def="", $a_tax_node=0, $a_add_amet_fields=false, $a_amet_filter="")
 Get all terms for given set of glossary ids. More...
 
static getFirstLetters ($a_glo_id, $a_tax_node=0)
 Get all terms for given set of glossary ids. More...
 
static getNumberOfUsages ($a_term_id)
 Get number of usages. More...
 
static getUsages ($a_term_id)
 Get number of usages. More...
 
static getTermsOfGlossary ($a_glo_id)
 Get terms of glossary. More...
 

Data Fields

 $ilias
 
 $lng
 
 $tpl
 
 $id
 
 $glossary
 
 $term
 
 $language
 
 $glo_id
 
 $import_id
 

Detailed Description

Class ilGlossaryTerm.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 12 of file class.ilGlossaryTerm.php.

Member Function Documentation

◆ _copyTerm()

ilGlossaryTerm::_copyTerm (   $a_term_id,
  $a_glossary_id 
)

Copy a term to a glossary.

Parameters

Definition at line 535 of file class.ilGlossaryTerm.php.

References ilMD\cloneMD(), ilGlossaryDefinition\getDefinitionList(), and ilGlossaryTerm().

Referenced by ilObjGlossary\cloneObject(), and ilSCORM2004Page\performAutomaticModifications().

536  {
537  $old_term = new ilGlossaryTerm($a_term_id);
538 
539  // copy the term
540  $new_term = new ilGlossaryTerm();
541  $new_term->setTerm($old_term->getTerm());
542  $new_term->setLanguage($old_term->getLanguage());
543  $new_term->setGlossaryId($a_glossary_id);
544  $new_term->create();
545 
546  // copy the definitions
547  include_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
548  $def_list = ilGlossaryDefinition::getDefinitionList($a_term_id);
549  foreach ($def_list as $def)
550  {
551  $old_def = new ilGlossaryDefinition($def["id"]);
552 
553  $new_def = new ilGlossaryDefinition();
554  $new_def->setShortText($old_def->getShortText());
555  $new_def->setNr($old_def->getNr());
556  $new_def->setTermId($new_term->getId());
557  $new_def->create();
558 
559  // copy meta data
560  include_once("Services/MetaData/classes/class.ilMD.php");
561  $md = new ilMD($old_term->getGlossaryId(),
562  $old_def->getPageObject()->getId(),
563  $old_def->getPageObject()->getParentType());
564  $new_md = $md->cloneMD($a_glossary_id,
565  $new_def->getPageObject()->getId(),
566  $old_def->getPageObject()->getParentType());
567 
568 
569  $new_page = $new_def->getPageObject();
570  $old_def->getPageObject()->copy($new_page->getId(), $new_page->getParentType(), $new_page->getParentId(), true);
571 
572  // page content
573  //$new_def->getPageObject()->setXMLContent($old_def->getPageObject()->copyXmlContent(true));
574  //$new_def->getPageObject()->buildDom();
575  //$new_def->getPageObject()->update();
576 
577  }
578 
579  return $new_term->getId();
580  }
& cloneMD($a_rbac_id, $a_obj_id, $a_obj_type)
Definition: class.ilMD.php:361
getDefinitionList($a_term_id)
static
ilGlossaryTerm($a_id=0)
Constructor public.
Class ilGlossaryDefinition.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _exists()

ilGlossaryTerm::_exists (   $a_id)

checks wether a glossary term with specified id exists or not

Parameters
int$idid
Returns
boolean true, if glossary term exists

Definition at line 105 of file class.ilGlossaryTerm.php.

References ilInternalLink\_extractObjIdOfTarget().

Referenced by ilInternalLink\_exists(), and ilLinksTableGUI\fillRow().

106  {
107  global $ilDB;
108 
109  include_once("./Services/COPage/classes/class.ilInternalLink.php");
110  if (is_int(strpos($a_id, "_")))
111  {
113  }
114 
115  $q = "SELECT * FROM glossary_term WHERE id = ".
116  $ilDB->quote($a_id, "integer");
117  $obj_set = $ilDB->query($q);
118  if ($obj_rec = $ilDB->fetchAssoc($obj_set))
119  {
120  return true;
121  }
122  else
123  {
124  return false;
125  }
126 
127  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _getIdForImportId()

ilGlossaryTerm::_getIdForImportId (   $a_import_id)

get current term id for import id (static)

Parameters
int$a_import_idimport id
Returns
int id

Definition at line 71 of file class.ilGlossaryTerm.php.

References ilObject\_hasUntrashedReference(), and _lookGlossaryID().

Referenced by ilInternalLink\_getIdForImportId().

72  {
73  global $ilDB;
74 
75  if ($a_import_id == "")
76  {
77  return 0;
78  }
79 
80  $q = "SELECT * FROM glossary_term WHERE import_id = ".
81  $ilDB->quote($a_import_id, "text").
82  " ORDER BY create_date DESC";
83  $term_set = $ilDB->query($q);
84  while ($term_rec = $ilDB->fetchAssoc($term_set))
85  {
86  $glo_id = ilGlossaryTerm::_lookGlossaryID($term_rec["id"]);
87 
89  {
90  return $term_rec["id"];
91  }
92  }
93 
94  return 0;
95  }
_hasUntrashedReference($a_obj_id)
checks wether an object has at least one reference that is not in trash
_lookGlossaryID($term_id)
get glossary id form term id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _lookGlossaryID()

ilGlossaryTerm::_lookGlossaryID (   $term_id)

get glossary id form term id

Definition at line 303 of file class.ilGlossaryTerm.php.

References $query.

Referenced by ilObjGlossaryAccess\_checkGoto(), _getIdForImportId(), ilGlossaryTermGUI\_goto(), ilObjGlossaryGUI\addDefinition(), ilObjGlossaryGUI\confirmTermDeletion(), ilGlossaryDefinition\createMetaData(), ilGlossaryDefinition\deleteMetaData(), ilGlossaryDefinition\exportXMLMetaData(), ilGlossaryPresentationGUI\getLinkXML(), ilObjMediaObject\getParentObjectIdForUsage(), ilGlossaryPresentationGUI\ilGlossaryPresentationGUI(), ilObjGlossaryGUI\ilObjGlossaryGUI(), ilGlossaryDefinition\MDUpdateListener(), ilSCORM2004Page\performAutomaticModifications(), and ilGlossaryDefinition\updateMetaData().

304  {
305  global $ilDB;
306 
307  $query = "SELECT * FROM glossary_term WHERE id = ".
308  $ilDB->quote($term_id, "integer");
309  $obj_set = $ilDB->query($query);
310  $obj_rec = $ilDB->fetchAssoc($obj_set);
311 
312  return $obj_rec["glo_id"];
313  }
+ Here is the caller graph for this function:

◆ _lookGlossaryTerm()

ilGlossaryTerm::_lookGlossaryTerm (   $term_id)

get glossary term

Definition at line 318 of file class.ilGlossaryTerm.php.

References $query.

Referenced by ilShopResultPresentationGUI\__appendChildLinks(), SurveyQuestion\addInternalLink(), ilTermUsagesTableGUI\fillRow(), ilLinksTableGUI\fillRow(), ilMediaPoolPageUsagesTableGUI\fillRow(), ilMediaObjectUsagesTableGUI\fillRow(), ilSCORM2004Asset\getGlossaryTermIds(), ilObjGlossarySubItemListGUI\getHTML(), ilObjGlossaryGUI\getTemplate(), ilLinkInputGUI\getTranslatedValue(), SurveyQuestion\setMaterial(), and ilLMPresentationGUI\showPrintView().

319  {
320  global $ilDB;
321 
322  $query = "SELECT * FROM glossary_term WHERE id = ".
323  $ilDB->quote($term_id, "integer");
324  $obj_set = $ilDB->query($query);
325  $obj_rec = $ilDB->fetchAssoc($obj_set);
326 
327  return $obj_rec["term"];
328  }
+ Here is the caller graph for this function:

◆ _lookLanguage()

ilGlossaryTerm::_lookLanguage (   $term_id)

lookup term language

Definition at line 333 of file class.ilGlossaryTerm.php.

References $query.

Referenced by ilGlossaryDefinition\createMetaData().

334  {
335  global $ilDB;
336 
337  $query = "SELECT * FROM glossary_term WHERE id = ".
338  $ilDB->quote($term_id, "integer");
339  $obj_set = $ilDB->query($query);
340  $obj_rec = $ilDB->fetchAssoc($obj_set);
341 
342  return $obj_rec["language"];
343  }
+ Here is the caller graph for this function:

◆ create()

ilGlossaryTerm::create ( )

create new glossary term

Definition at line 248 of file class.ilGlossaryTerm.php.

References getImportId(), and setId().

249  {
250  global $ilDB;
251 
252  $this->setId($ilDB->nextId("glossary_term"));
253  $ilDB->manipulate("INSERT INTO glossary_term (id, glo_id, term, language, import_id, create_date, last_update)".
254  " VALUES (".
255  $ilDB->quote($this->getId(), "integer").", ".
256  $ilDB->quote($this->getGlossaryId(), "integer").", ".
257  $ilDB->quote($this->term, "text").", ".
258  $ilDB->quote($this->language, "text").",".
259  $ilDB->quote($this->getImportId(), "text").",".
260  $ilDB->now().", ".
261  $ilDB->now().")");
262  }
getImportId()
get import id
setId($a_id)
set glossary term id (= glossary item id)
+ Here is the call graph for this function:

◆ delete()

ilGlossaryTerm::delete ( )

delete glossary term (and all its definition objects)

Definition at line 268 of file class.ilGlossaryTerm.php.

References ilGlossaryDefinition\getDefinitionList(), and getId().

269  {
270  global $ilDB;
271 
272  require_once("./Modules/Glossary/classes/class.ilGlossaryDefinition.php");
274  foreach($defs as $def)
275  {
276  $def_obj =& new ilGlossaryDefinition($def["id"]);
277  $def_obj->delete();
278  }
279  $ilDB->manipulate("DELETE FROM glossary_term ".
280  " WHERE id = ".$ilDB->quote($this->getId(), "integer"));
281  }
getId()
get term id (= glossary item id)
getDefinitionList($a_term_id)
static
Class ilGlossaryDefinition.
+ Here is the call graph for this function:

◆ exportXML()

ilGlossaryTerm::exportXML ( $a_xml_writer,
  $a_inst 
)

export xml

Definition at line 484 of file class.ilGlossaryTerm.php.

References ilGlossaryDefinition\getDefinitionList(), getId(), getLanguage(), and getTerm().

485  {
486 
487  $attrs = array();
488  $attrs["Language"] = $this->getLanguage();
489  $attrs["Id"] = "il_".IL_INST_ID."_git_".$this->getId();
490  $a_xml_writer->xmlStartTag("GlossaryItem", $attrs);
491 
492  $attrs = array();
493  $a_xml_writer->xmlElement("GlossaryTerm", $attrs, $this->getTerm());
494 
496 
497  foreach($defs as $def)
498  {
499  $definition = new ilGlossaryDefinition($def["id"]);
500  $definition->exportXML($a_xml_writer, $a_inst);
501  }
502 
503  $a_xml_writer->xmlEndTag("GlossaryItem");
504  }
getId()
get term id (= glossary item id)
getDefinitionList($a_term_id)
static
getLanguage()
get language
Class ilGlossaryDefinition.
+ Here is the call graph for this function:

◆ getFirstLetters()

static ilGlossaryTerm::getFirstLetters (   $a_glo_id,
  $a_tax_node = 0 
)
static

Get all terms for given set of glossary ids.

Parameters
integer/arrayarray of glossary ids for meta glossaries
stringsearchstring
stringfirst letter
Returns
array array of terms

Definition at line 435 of file class.ilGlossaryTerm.php.

References $in, ilObjTaxonomy\getSubTreeItems(), and ilObjTaxonomy\getUsageOfObject().

Referenced by ilObjGlossary\getFirstLetters().

436  {
437  global $ilDB;
438 
439  $terms = array();
440 
441  // meta glossary
442  if (is_array($a_glo_id))
443  {
444  $where = $ilDB->in("glo_id", $a_glo_id, false, "integer");
445  }
446  else
447  {
448  $where = " glo_id = ".$ilDB->quote($a_glo_id, "integer")." ";
449 
450  // get all term ids under taxonomy node (if given)
451  if ($a_tax_node > 1)
452  {
453  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
454  $tax_ids = ilObjTaxonomy::getUsageOfObject($a_glo_id);
455  if (count($tax_ids) > 0)
456  {
457  $items = ilObjTaxonomy::getSubTreeItems("glo", $a_glo_id, "term", $tax_ids[0], $a_tax_node);
458  $sub_tree_ids = array();
459  foreach ($items as $i)
460  {
461  $sub_tree_ids[] = $i["item_id"];
462  }
463  $in = " AND ".$ilDB->in("id", $sub_tree_ids, false, "integer");
464  }
465  }
466 
467  $where.= $in;
468  }
469 
470  $q = "SELECT DISTINCT ".$ilDB->upper($ilDB->substr("term", 1, 1))." let FROM glossary_term WHERE ".$where." ORDER BY let";
471  $let_set = $ilDB->query($q);
472 
473  $lets = array();
474  while ($let_rec = $ilDB->fetchAssoc($let_set))
475  {
476  $let[$let_rec["let"]] = $let_rec["let"];
477  }
478  return $let;
479  }
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
static getSubTreeItems($a_comp, $a_obj_id, $a_item_type, $a_tax_id, $a_node)
Get all assigned items under a node.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGlossaryId()

ilGlossaryTerm::getGlossaryId ( )

get glossary id

Returns
int glossary id

Definition at line 179 of file class.ilGlossaryTerm.php.

References $glo_id.

180  {
181  return $this->glo_id;
182  }

◆ getId()

ilGlossaryTerm::getId ( )

get term id (= glossary item id)

Returns
int glossary term id

Definition at line 146 of file class.ilGlossaryTerm.php.

References $id.

Referenced by delete(), exportXML(), and update().

147  {
148  return $this->id;
149  }
+ Here is the caller graph for this function:

◆ getImportId()

ilGlossaryTerm::getImportId ( )

get import id

Definition at line 239 of file class.ilGlossaryTerm.php.

References $import_id.

Referenced by create().

240  {
241  return $this->import_id;
242  }
+ Here is the caller graph for this function:

◆ getLanguage()

ilGlossaryTerm::getLanguage ( )

get language

Returns
string two letter language code

Definition at line 221 of file class.ilGlossaryTerm.php.

References $language.

Referenced by exportXML().

222  {
223  return $this->language;
224  }
+ Here is the caller graph for this function:

◆ getNumberOfUsages()

static ilGlossaryTerm::getNumberOfUsages (   $a_term_id)
static

Get number of usages.

Parameters
intterm id
Returns
int number of usages

Definition at line 512 of file class.ilGlossaryTerm.php.

References getUsages().

Referenced by ilObjGlossaryGUI\confirmDefinitionDeletion(), ilObjGlossaryGUI\confirmTermDeletion(), ilTermDefinitionEditorGUI\executeCommand(), ilTermListTableGUI\fillRow(), and ilGlossaryTermGUI\getTabs().

513  {
514  return count(ilGlossaryTerm::getUsages($a_term_id));
515  }
static getUsages($a_term_id)
Get number of usages.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTerm()

ilGlossaryTerm::getTerm ( )

get term

Returns
string term

Definition at line 201 of file class.ilGlossaryTerm.php.

References $term.

Referenced by exportXML().

202  {
203  return $this->term;
204  }
+ Here is the caller graph for this function:

◆ getTermList()

static ilGlossaryTerm::getTermList (   $a_glo_id,
  $searchterm = "",
  $a_first_letter = "",
  $a_def = "",
  $a_tax_node = 0,
  $a_add_amet_fields = false,
  $a_amet_filter = "" 
)
static

Get all terms for given set of glossary ids.

Parameters
integer/arrayarray of glossary ids for meta glossaries
stringsearchstring
stringfirst letter
Returns
array array of terms

Definition at line 353 of file class.ilGlossaryTerm.php.

References $in, ilObjTaxonomy\getSubTreeItems(), ilObjTaxonomy\getUsageOfObject(), and ilAdvancedMDValues\queryForRecords().

Referenced by ilPCParagraph\autoLinkGlossaries(), ilObjContentObject\autoLinkGlossaryTerms(), ilObjGlossary\cloneObject(), and ilObjGlossary\getTermList().

355  {
356  global $ilDB;
357 
358  $terms = array();
359 
360  // get all term ids under taxonomy node (if given)
361  if ($a_tax_node > 1)
362  {
363  include_once("./Services/Taxonomy/classes/class.ilObjTaxonomy.php");
364  $tax_ids = ilObjTaxonomy::getUsageOfObject($a_glo_id);
365  if (count($tax_ids) > 0)
366  {
367  $items = ilObjTaxonomy::getSubTreeItems("glo", $a_glo_id, "term", $tax_ids[0], $a_tax_node);
368  $sub_tree_ids = array();
369  foreach ($items as $i)
370  {
371  $sub_tree_ids[] = $i["item_id"];
372  }
373  $in = " AND ".$ilDB->in("gt.id", $sub_tree_ids, false, "integer");
374  }
375  }
376 
377  if ($a_def != "")
378  {
379  $join = " JOIN glossary_definition gd ON (gd.term_id = gt.id)".
380  " JOIN page_object ON (".
381  "page_object.parent_id = ".$ilDB->quote($a_glo_id, "integer").
382  " AND page_object.parent_type = ".$ilDB->quote("gdf", "text").
383  " AND page_object.page_id = gd.id".
384  " AND ".$ilDB->like("page_object.content", "text", "%".$a_def."%").
385  ")";
386  }
387 
388  $searchterm = (!empty ($searchterm))
389  ? " AND ".$ilDB->like("term", "text", "%".$searchterm."%")." "
390  : "";
391 
392  if ($a_first_letter != "")
393  {
394  $searchterm.= " AND ".$ilDB->upper($ilDB->substr("term", 1, 1))." = ".$ilDB->upper($ilDB->quote($a_first_letter, "text"))." ";
395  }
396 
397  // meta glossary
398  if (is_array($a_glo_id))
399  {
400  $where = $ilDB->in("glo_id", $a_glo_id, false, "integer");
401  }
402  else
403  {
404  $where = " glo_id = ".$ilDB->quote($a_glo_id, "integer")." ";
405  }
406 
407  $where.= $in;
408 
409  $q = "SELECT gt.term, gt.id, gt.glo_id, gt.language FROM glossary_term gt ".$join." WHERE ".$where.$searchterm." ORDER BY term";
410  $term_set = $ilDB->query($q);
411 //var_dump($q);
412  while ($term_rec = $ilDB->fetchAssoc($term_set))
413  {
414  $terms[] = array("term" => $term_rec["term"],
415  "language" => $term_rec["language"], "id" => $term_rec["id"], "glo_id" => $term_rec["glo_id"]);
416  }
417 
418  // add advanced metadata
419  if ($a_add_amet_fields || is_array($a_amet_filter))
420  {
421  include_once("./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php");
422  $terms = ilAdvancedMDValues::queryForRecords($a_glo_id, "term", $terms, "glo_id", "id", $a_amet_filter);
423  }
424  return $terms;
425  }
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
static queryForRecords($a_obj_id, $a_subtype, $a_records, $a_obj_id_key, $a_obj_subid_key, $a_amet_filter="")
Query data for given object records.
static getSubTreeItems($a_comp, $a_obj_id, $a_item_type, $a_tax_id, $a_node)
Get all assigned items under a node.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTermsOfGlossary()

static ilGlossaryTerm::getTermsOfGlossary (   $a_glo_id)
static

Get terms of glossary.

Parameters

Definition at line 588 of file class.ilGlossaryTerm.php.

Referenced by ilGlossaryDefinition\setShortTextsDirty().

589  {
590  global $ilDB;
591 
592  $set = $ilDB->query("SELECT id FROM glossary_term WHERE ".
593  " glo_id = ".$ilDB->quote($a_glo_id, "integer")
594  );
595  $ids = array();
596  while ($rec = $ilDB->fetchAssoc($set))
597  {
598  $ids[] = $rec["id"];
599  }
600  return $ids;
601  }
+ Here is the caller graph for this function:

◆ getUsages()

static ilGlossaryTerm::getUsages (   $a_term_id)
static

Get number of usages.

Parameters
intterm id
Returns
int number of usages

Definition at line 523 of file class.ilGlossaryTerm.php.

References ilInternalLink\_getSourcesOfTarget().

Referenced by ilTermUsagesTableGUI\getItems(), and getNumberOfUsages().

524  {
525  include_once("./Services/COPage/classes/class.ilInternalLink.php");
526  return (ilInternalLink::_getSourcesOfTarget("git", $a_term_id, 0));
527  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ilGlossaryTerm()

ilGlossaryTerm::ilGlossaryTerm (   $a_id = 0)

Constructor public.

Definition at line 29 of file class.ilGlossaryTerm.php.

References $ilias, $lng, $tpl, and read().

Referenced by _copyTerm().

30  {
31  global $lng, $ilias, $tpl;
32 
33  $this->lng =& $lng;
34  $this->ilias =& $ilias;
35  $this->tpl =& $tpl;
36 
37  $this->id = $a_id;
38  $this->type = "term";
39  if ($a_id != 0)
40  {
41  $this->read();
42  }
43  }
redirection script todo: (a better solution should control the processing via a xml file) ...
read()
read glossary term data
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read()

ilGlossaryTerm::read ( )

read glossary term data

Definition at line 48 of file class.ilGlossaryTerm.php.

References setGlossaryId(), setImportId(), setLanguage(), and setTerm().

Referenced by ilGlossaryTerm().

49  {
50  global $ilDB;
51 
52  $q = "SELECT * FROM glossary_term WHERE id = ".
53  $ilDB->quote($this->id, "integer");
54  $term_set = $ilDB->query($q);
55  $term_rec = $ilDB->fetchAssoc($term_set);
56 
57  $this->setTerm($term_rec["term"]);
58  $this->setImportId($term_rec["import_id"]);
59  $this->setLanguage($term_rec["language"]);
60  $this->setGlossaryId($term_rec["glo_id"]);
61 
62  }
setLanguage($a_language)
set language
setGlossaryId($a_glo_id)
set glossary id
setTerm($a_term)
set term
setImportId($a_import_id)
set import id
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setGlossary()

ilGlossaryTerm::setGlossary ( $a_glossary)

set glossary object

Parameters
object$a_glossaryglossary object

Definition at line 156 of file class.ilGlossaryTerm.php.

References setGlossaryId().

157  {
158  $this->glossary =& $a_glossary;
159  $this->setGlossaryId($a_glossary->getId());
160  }
setGlossaryId($a_glo_id)
set glossary id
+ Here is the call graph for this function:

◆ setGlossaryId()

ilGlossaryTerm::setGlossaryId (   $a_glo_id)

set glossary id

Parameters
int$a_glo_idglossary id

Definition at line 168 of file class.ilGlossaryTerm.php.

Referenced by read(), and setGlossary().

169  {
170  $this->glo_id = $a_glo_id;
171  }
+ Here is the caller graph for this function:

◆ setId()

ilGlossaryTerm::setId (   $a_id)

set glossary term id (= glossary item id)

Parameters
int$a_idglossary term id

Definition at line 135 of file class.ilGlossaryTerm.php.

Referenced by create().

136  {
137  $this->id = $a_id;
138  }
+ Here is the caller graph for this function:

◆ setImportId()

ilGlossaryTerm::setImportId (   $a_import_id)

set import id

Definition at line 230 of file class.ilGlossaryTerm.php.

Referenced by read().

231  {
232  $this->import_id = $a_import_id;
233  }
+ Here is the caller graph for this function:

◆ setLanguage()

ilGlossaryTerm::setLanguage (   $a_language)

set language

Parameters
string$a_languagetwo letter language code

Definition at line 212 of file class.ilGlossaryTerm.php.

Referenced by read().

213  {
214  $this->language = $a_language;
215  }
+ Here is the caller graph for this function:

◆ setTerm()

ilGlossaryTerm::setTerm (   $a_term)

set term

Parameters
string$a_termterm

Definition at line 190 of file class.ilGlossaryTerm.php.

Referenced by read().

191  {
192  $this->term = $a_term;
193  }
+ Here is the caller graph for this function:

◆ update()

ilGlossaryTerm::update ( )

update glossary term

Definition at line 287 of file class.ilGlossaryTerm.php.

References getId().

288  {
289  global $ilDB;
290 
291  $ilDB->manipulate("UPDATE glossary_term SET ".
292  " glo_id = ".$ilDB->quote($this->getGlossaryId(), "integer").", ".
293  " term = ".$ilDB->quote($this->getTerm(), "text").", ".
294  " import_id = ".$ilDB->quote($this->getImportId(), "text").", ".
295  " language = ".$ilDB->quote($this->getLanguage(), "text").", ".
296  " last_update = ".$ilDB->now()." ".
297  " WHERE id = ".$ilDB->quote($this->getId(), "integer"));
298  }
getId()
get term id (= glossary item id)
+ Here is the call graph for this function:

Field Documentation

◆ $glo_id

ilGlossaryTerm::$glo_id

Definition at line 22 of file class.ilGlossaryTerm.php.

Referenced by getGlossaryId().

◆ $glossary

ilGlossaryTerm::$glossary

Definition at line 19 of file class.ilGlossaryTerm.php.

◆ $id

ilGlossaryTerm::$id

Definition at line 18 of file class.ilGlossaryTerm.php.

Referenced by getId().

◆ $ilias

ilGlossaryTerm::$ilias

Definition at line 14 of file class.ilGlossaryTerm.php.

Referenced by ilGlossaryTerm().

◆ $import_id

ilGlossaryTerm::$import_id

Definition at line 23 of file class.ilGlossaryTerm.php.

Referenced by getImportId().

◆ $language

ilGlossaryTerm::$language

Definition at line 21 of file class.ilGlossaryTerm.php.

Referenced by getLanguage().

◆ $lng

ilGlossaryTerm::$lng

Definition at line 15 of file class.ilGlossaryTerm.php.

Referenced by ilGlossaryTerm().

◆ $term

ilGlossaryTerm::$term

Definition at line 20 of file class.ilGlossaryTerm.php.

Referenced by getTerm().

◆ $tpl

ilGlossaryTerm::$tpl

Definition at line 16 of file class.ilGlossaryTerm.php.

Referenced by ilGlossaryTerm().


The documentation for this class was generated from the following file: