ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
TaxonomyManager.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24
26{
28 protected \ilObjGlossary $glossary;
29
30 public function __construct(
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}
__construct(DomainService $tax_domain, \ilObjGlossary $glossary)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...