ILIAS  trunk Revision v11.0_alpha-2658-ge2404539063
ILIAS\MetaData\Vocabularies\Copyright\Bridge Class Reference
+ Inheritance diagram for ILIAS\MetaData\Vocabularies\Copyright\Bridge:
+ Collaboration diagram for ILIAS\MetaData\Vocabularies\Copyright\Bridge:

Public Member Functions

 __construct (FactoryInterface $factory, SettingsInterface $settings, CopyrightRepository $copyright_repository, IdentifierHandler $identifier_handler)
 
 vocabulary (SlotIdentifier $slot)
 
 labelsForValues (SlotIdentifier $slot, string ... $values)
 

Protected Attributes

FactoryInterface $factory
 
SettingsInterface $settings
 
CopyrightRepository $copyright_repository
 
IdentifierHandler $identifier_handler
 

Detailed Description

Definition at line 32 of file Bridge.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\MetaData\Vocabularies\Copyright\Bridge::__construct ( FactoryInterface  $factory,
SettingsInterface  $settings,
CopyrightRepository  $copyright_repository,
IdentifierHandler  $identifier_handler 
)

Member Function Documentation

◆ labelsForValues()

ILIAS\MetaData\Vocabularies\Copyright\Bridge::labelsForValues ( SlotIdentifier  $slot,
string ...  $values 
)
Returns
LabelledValueInterface[]

Implements ILIAS\MetaData\Vocabularies\Copyright\BridgeInterface.

Definition at line 73 of file Bridge.php.

References ILIAS\Repository\settings().

76  : \Generator {
77  if (
78  !$this->settings->isCopyrightSelectionActive() ||
79  $slot !== SlotIdentifier::RIGHTS_DESCRIPTION
80  ) {
81  return;
82  }
83 
84  foreach ($this->copyright_repository->getAllEntries() as $copyright) {
85  $identifier = $this->identifier_handler->buildIdentifierFromEntryID($copyright->id());
86  if (!in_array($identifier, $values)) {
87  continue;
88  }
89  yield new LabelledValue(
90  $identifier,
91  $copyright->title()
92  );
93  }
94  }
+ Here is the call graph for this function:

◆ vocabulary()

ILIAS\MetaData\Vocabularies\Copyright\Bridge::vocabulary ( SlotIdentifier  $slot)

Implements ILIAS\MetaData\Vocabularies\Copyright\BridgeInterface.

Definition at line 51 of file Bridge.php.

References factory(), null, and ILIAS\Repository\settings().

51  : ?VocabularyInterface
52  {
53  if (
54  !$this->settings->isCopyrightSelectionActive() ||
55  $slot !== SlotIdentifier::RIGHTS_DESCRIPTION
56  ) {
57  return null;
58  }
59 
60  $values = [];
61  foreach ($this->copyright_repository->getAllEntries() as $copyright) {
62  $values[] = $this->identifier_handler->buildIdentifierFromEntryID($copyright->id());
63  }
64  if (empty($values)) {
65  return null;
66  }
67  return $this->factory->copyright(...$values)->get();
68  }
factory()
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

Field Documentation

◆ $copyright_repository

CopyrightRepository ILIAS\MetaData\Vocabularies\Copyright\Bridge::$copyright_repository
protected

Definition at line 36 of file Bridge.php.

Referenced by ILIAS\MetaData\Vocabularies\Copyright\Bridge\__construct().

◆ $factory

FactoryInterface ILIAS\MetaData\Vocabularies\Copyright\Bridge::$factory
protected

Definition at line 34 of file Bridge.php.

Referenced by ILIAS\MetaData\Vocabularies\Copyright\Bridge\__construct().

◆ $identifier_handler

IdentifierHandler ILIAS\MetaData\Vocabularies\Copyright\Bridge::$identifier_handler
protected

Definition at line 37 of file Bridge.php.

Referenced by ILIAS\MetaData\Vocabularies\Copyright\Bridge\__construct().

◆ $settings

SettingsInterface ILIAS\MetaData\Vocabularies\Copyright\Bridge::$settings
protected

Definition at line 35 of file Bridge.php.

Referenced by ILIAS\MetaData\Vocabularies\Copyright\Bridge\__construct().


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