ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\MetaData\Vocabularies\Dispatch\Reader Class Reference
+ Inheritance diagram for ILIAS\MetaData\Vocabularies\Dispatch\Reader:
+ Collaboration diagram for ILIAS\MetaData\Vocabularies\Dispatch\Reader:

Public Member Functions

 __construct (CopyrightBridge $copyright_bridge, ControlledRepo $controlled_repo, StandardRepo $standard_repo)
 
 vocabulary (string $vocab_id)
 
 vocabulariesForSlots (SlotIdentifier ... $slots)
 
 activeVocabulariesForSlots (SlotIdentifier ... $slots)
 
 vocabulary (string $vocab_id)
 
 vocabulariesForSlots (SlotIdentifier ... $slots)
 
 activeVocabulariesForSlots (SlotIdentifier ... $slots)
 

Protected Attributes

CopyrightBridge $copyright_bridge
 
ControlledRepo $controlled_repo
 
StandardRepo $standard_repo
 

Detailed Description

Definition at line 30 of file Reader.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\MetaData\Vocabularies\Dispatch\Reader::__construct ( CopyrightBridge  $copyright_bridge,
ControlledRepo  $controlled_repo,
StandardRepo  $standard_repo 
)

Member Function Documentation

◆ activeVocabulariesForSlots()

ILIAS\MetaData\Vocabularies\Dispatch\Reader::activeVocabulariesForSlots ( SlotIdentifier ...  $slots)
Returns
VocabularyInterface[]

Implements ILIAS\MetaData\Vocabularies\Dispatch\ReaderInterface.

Definition at line 80 of file Reader.php.

82 : \Generator {
83 foreach ($slots as $slot) {
84 $from_copyright = $this->copyright_bridge->vocabulary($slot);
85 if (!is_null($from_copyright) && $from_copyright->isActive()) {
86 yield $from_copyright;
87 }
88 }
89 yield from $this->controlled_repo->getActiveVocabulariesForSlots(...$slots);
90 yield from $this->standard_repo->getActiveVocabularies(...$slots);
91 }

◆ vocabulariesForSlots()

ILIAS\MetaData\Vocabularies\Dispatch\Reader::vocabulariesForSlots ( SlotIdentifier ...  $slots)
Returns
VocabularyInterface[]

Implements ILIAS\MetaData\Vocabularies\Dispatch\ReaderInterface.

Definition at line 64 of file Reader.php.

66 : \Generator {
67 foreach ($slots as $slot) {
68 $from_copyright = $this->copyright_bridge->vocabulary($slot);
69 if (!is_null($from_copyright)) {
70 yield $from_copyright;
71 }
72 }
73 yield from $this->controlled_repo->getVocabulariesForSlots(...$slots);
74 yield from $this->standard_repo->getVocabularies(...$slots);
75 }

◆ vocabulary()

ILIAS\MetaData\Vocabularies\Dispatch\Reader::vocabulary ( string  $vocab_id)

Implements ILIAS\MetaData\Vocabularies\Dispatch\ReaderInterface.

Definition at line 46 of file Reader.php.

46 : VocabularyInterface
47 {
48 $slot = SlotIdentifier::tryFrom($vocab_id);
49 if ($slot === null) {
50 return $this->controlled_repo->getVocabulary($vocab_id);
51 }
52
53 $from_copyright = $this->copyright_bridge->vocabulary($slot);
54 if ($from_copyright !== null) {
55 return $from_copyright;
56 }
57
58 return $this->standard_repo->getVocabulary($slot);
59 }

Field Documentation

◆ $controlled_repo

ControlledRepo ILIAS\MetaData\Vocabularies\Dispatch\Reader::$controlled_repo
protected

Definition at line 33 of file Reader.php.

Referenced by ILIAS\MetaData\Vocabularies\Dispatch\Reader\__construct().

◆ $copyright_bridge

CopyrightBridge ILIAS\MetaData\Vocabularies\Dispatch\Reader::$copyright_bridge
protected

Definition at line 32 of file Reader.php.

Referenced by ILIAS\MetaData\Vocabularies\Dispatch\Reader\__construct().

◆ $standard_repo

StandardRepo ILIAS\MetaData\Vocabularies\Dispatch\Reader::$standard_repo
protected

Definition at line 34 of file Reader.php.

Referenced by ILIAS\MetaData\Vocabularies\Dispatch\Reader\__construct().


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