ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
TaxonomyManager.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
24 
26 {
28  protected \ilObjGlossary $glossary;
29 
30  public function __construct(
31  DomainService $tax_domain,
32  \ilObjGlossary $glossary
33  ) {
34  $this->glossary = $glossary;
35  $this->tax_domain = $tax_domain;
36  }
37 
38  public function showInEditing(): bool
39  {
40  if (!$this->tax_domain->isActivated($this->glossary->getId())) {
41  return false;
42  }
43  $usage = $this->tax_domain->getUsageOfObject($this->glossary->getId());
44  return count($usage) === 1;
45  }
46  public function showInPresentation(): bool
47  {
48  return $this->showInEditing() && $this->glossary->getShowTaxonomy();
49  }
50 
51  public function getTaxonomyId(): int
52  {
53  $usage = $this->tax_domain->getUsageOfObject($this->glossary->getId());
54  if (count($usage) === 1) {
55  return (int) current($usage);
56  }
57  return 0;
58  }
59 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(DomainService $tax_domain, \ilObjGlossary $glossary)