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

Public Member Functions

 __construct (PathFactory $path_factory, NavigatorFactoryInterface $navigator_factory, StructureSetInterface $structure)
 
 pathForSlot (Identifier $identifier)
 
 isSlotConditional (Identifier $identifier)
 
 conditionForSlot (Identifier $identifier)
 
 identiferFromPathAndCondition (PathInterface $path_to_element, ?PathInterface $path_to_condition, ?string $condition_value)
 
 allSlotsForPath (PathInterface $path_to_element)
 
 doesSlotExist (PathInterface $path_to_element, ?PathInterface $path_to_condition, ?string $condition_value)
 
 dataTypeForSlot (Identifier $identifier)
 

Protected Member Functions

 buildPath (string ... $steps)
 
 buildCondition (string $condition_value, string|StepToken ... $steps_to_condition,)
 

Protected Attributes

PathFactory $path_factory
 
NavigatorFactoryInterface $navigator_factory
 
StructureSetInterface $structure
 

Detailed Description

Definition at line 32 of file Handler.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\MetaData\Vocabularies\Slots\Handler::__construct ( PathFactory  $path_factory,
NavigatorFactoryInterface  $navigator_factory,
StructureSetInterface  $structure 
)

Definition at line 38 of file Handler.php.

References ILIAS\MetaData\Vocabularies\Slots\Handler\$navigator_factory, ILIAS\MetaData\Vocabularies\Slots\Handler\$path_factory, and ILIAS\MetaData\Vocabularies\Slots\Handler\$structure.

42  {
43  $this->path_factory = $path_factory;
44  $this->navigator_factory = $navigator_factory;
45  $this->structure = $structure;
46  }
StructureSetInterface $structure
Definition: Handler.php:36
NavigatorFactoryInterface $navigator_factory
Definition: Handler.php:35

Member Function Documentation

◆ allSlotsForPath()

ILIAS\MetaData\Vocabularies\Slots\Handler::allSlotsForPath ( PathInterface  $path_to_element)
Returns
Identifier[]

Implements ILIAS\MetaData\Vocabularies\Slots\HandlerInterface.

Definition at line 141 of file Handler.php.

References ILIAS\MetaData\Vocabularies\Slots\Handler\pathForSlot(), ILIAS\Export\ImportHandler\File\XML\Manifest\toString, and ILIAS\MetaData\Paths\PathInterface\toString().

141  : \Generator
142  {
143  foreach (Identifier::cases() as $identifier) {
144  if ($this->pathForSlot($identifier)->toString() === $path_to_element->toString()) {
145  yield $identifier;
146  }
147  }
148  }
pathForSlot(Identifier $identifier)
Definition: Handler.php:48
+ Here is the call graph for this function:

◆ buildCondition()

ILIAS\MetaData\Vocabularies\Slots\Handler::buildCondition ( string  $condition_value,
string|StepToken ...  $steps_to_condition 
)
protected

Definition at line 172 of file Handler.php.

References $path, and ILIAS\MetaData\Paths\Steps\SUPER.

Referenced by ILIAS\MetaData\Vocabularies\Slots\Handler\conditionForSlot().

175  : ConditionInterface {
176  $builder = $this->path_factory->custom();
177  foreach ($steps_to_condition as $step) {
178  if ($step === StepToken::SUPER) {
179  $builder = $builder->withNextStepToSuperElement();
180  continue;
181  }
182  $builder = $builder->withNextStep($step);
183  }
184  $path = $builder->withRelative(true)->get();
185 
186  return new Condition(
187  $condition_value,
188  $path
189  );
190  }
$path
Definition: ltiservices.php:29
+ Here is the caller graph for this function:

◆ buildPath()

ILIAS\MetaData\Vocabularies\Slots\Handler::buildPath ( string ...  $steps)
protected

Definition at line 163 of file Handler.php.

Referenced by ILIAS\MetaData\Vocabularies\Slots\Handler\pathForSlot().

163  : PathInterface
164  {
165  $builder = $this->path_factory->custom();
166  foreach ($steps as $step) {
167  $builder = $builder->withNextStep($step);
168  }
169  return $builder->get();
170  }
+ Here is the caller graph for this function:

◆ conditionForSlot()

ILIAS\MetaData\Vocabularies\Slots\Handler::conditionForSlot ( Identifier  $identifier)

Implements ILIAS\MetaData\Vocabularies\Slots\HandlerInterface.

Definition at line 91 of file Handler.php.

References ILIAS\MetaData\Vocabularies\Slots\Handler\buildCondition(), null, and ILIAS\MetaData\Paths\Steps\SUPER.

Referenced by ILIAS\MetaData\Vocabularies\Slots\Handler\identiferFromPathAndCondition(), and ILIAS\MetaData\Vocabularies\Slots\Handler\isSlotConditional().

91  : ?ConditionInterface
92  {
93  return match ($identifier) {
94  Identifier::LIFECYCLE_CONTRIBUTE_PUBLISHER => $this->buildCondition(
95  'publisher',
97  'role',
98  'value'
99  ),
100  Identifier::TECHNICAL_REQUIREMENT_BROWSER => $this->buildCondition(
101  'browser',
104  'type',
105  'value'
106  ),
107  Identifier::TECHNICAL_REQUIREMENT_OS => $this->buildCondition(
108  'operating system',
111  'type',
112  'value'
113  ),
114  default => null
115  };
116  }
buildCondition(string $condition_value, string|StepToken ... $steps_to_condition,)
Definition: Handler.php:172
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ dataTypeForSlot()

ILIAS\MetaData\Vocabularies\Slots\Handler::dataTypeForSlot ( Identifier  $identifier)

Implements ILIAS\MetaData\Vocabularies\Slots\HandlerInterface.

Definition at line 192 of file Handler.php.

References ILIAS\MetaData\Vocabularies\Slots\Handler\pathForSlot().

192  : DataType
193  {
194  return $this->navigator_factory->structureNavigator(
195  $this->pathForSlot($identifier),
196  $this->structure->getRoot()
197  )->elementAtFinalStep()->getDefinition()->dataType();
198  }
pathForSlot(Identifier $identifier)
Definition: Handler.php:48
+ Here is the call graph for this function:

◆ doesSlotExist()

ILIAS\MetaData\Vocabularies\Slots\Handler::doesSlotExist ( PathInterface  $path_to_element,
?PathInterface  $path_to_condition,
?string  $condition_value 
)

Implements ILIAS\MetaData\Vocabularies\Slots\HandlerInterface.

Definition at line 150 of file Handler.php.

References ILIAS\MetaData\Vocabularies\Slots\Handler\identiferFromPathAndCondition(), and ILIAS\Data\Description\NULL.

154  : bool {
155  $identifier = $this->identiferFromPathAndCondition(
156  $path_to_element,
157  $path_to_condition,
158  $condition_value
159  );
160  return $identifier !== Identifier::NULL;
161  }
identiferFromPathAndCondition(PathInterface $path_to_element, ?PathInterface $path_to_condition, ?string $condition_value)
Definition: Handler.php:118
+ Here is the call graph for this function:

◆ identiferFromPathAndCondition()

ILIAS\MetaData\Vocabularies\Slots\Handler::identiferFromPathAndCondition ( PathInterface  $path_to_element,
?PathInterface  $path_to_condition,
?string  $condition_value 
)

Implements ILIAS\MetaData\Vocabularies\Slots\HandlerInterface.

Definition at line 118 of file Handler.php.

References ILIAS\MetaData\Vocabularies\Slots\Handler\conditionForSlot(), ILIAS\Data\Description\NULL, ILIAS\MetaData\Vocabularies\Slots\Handler\pathForSlot(), ILIAS\Export\ImportHandler\File\XML\Manifest\toString, and ILIAS\MetaData\Paths\PathInterface\toString().

Referenced by ILIAS\MetaData\Vocabularies\Slots\Handler\doesSlotExist().

122  : Identifier {
123  foreach (Identifier::cases() as $identifier) {
124  if ($this->pathForSlot($identifier)->toString() !== $path_to_element->toString()) {
125  continue;
126  }
127 
128  $condition = $this->conditionForSlot($identifier);
129  if (
130  $condition?->value() !== $condition_value ||
131  $condition?->path()?->toString() !== $path_to_condition?->toString()
132  ) {
133  continue;
134  }
135 
136  return $identifier;
137  }
138  return Identifier::NULL;
139  }
conditionForSlot(Identifier $identifier)
Definition: Handler.php:91
pathForSlot(Identifier $identifier)
Definition: Handler.php:48
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isSlotConditional()

ILIAS\MetaData\Vocabularies\Slots\Handler::isSlotConditional ( Identifier  $identifier)

Implements ILIAS\MetaData\Vocabularies\Slots\HandlerInterface.

Definition at line 86 of file Handler.php.

References ILIAS\MetaData\Vocabularies\Slots\Handler\conditionForSlot().

86  : bool
87  {
88  return !is_null($this->conditionForSlot($identifier));
89  }
conditionForSlot(Identifier $identifier)
Definition: Handler.php:91
+ Here is the call graph for this function:

◆ pathForSlot()

ILIAS\MetaData\Vocabularies\Slots\Handler::pathForSlot ( Identifier  $identifier)

Implements ILIAS\MetaData\Vocabularies\Slots\HandlerInterface.

Definition at line 48 of file Handler.php.

References ILIAS\MetaData\Vocabularies\Slots\Handler\buildPath(), ILIAS\MetaData\Vocabularies\Slots\CLASSIFICATION_TAXON_ENTRY, and ILIAS\Data\Description\NULL.

Referenced by ILIAS\MetaData\Vocabularies\Slots\Handler\allSlotsForPath(), ILIAS\MetaData\Vocabularies\Slots\Handler\dataTypeForSlot(), and ILIAS\MetaData\Vocabularies\Slots\Handler\identiferFromPathAndCondition().

48  : PathInterface
49  {
50  return match ($identifier) {
51  Identifier::GENERAL_STRUCTURE => $this->buildPath('general', 'structure', 'value'),
52  Identifier::GENERAL_AGGREGATION_LEVEL => $this->buildPath('general', 'aggregationLevel', 'value'),
53  Identifier::GENERAL_COVERAGE => $this->buildPath('general', 'coverage', 'string'),
54  Identifier::GENERAL_IDENTIFIER_CATALOG => $this->buildPath('general', 'identifier', 'catalog'),
55  Identifier::LIFECYCLE_STATUS => $this->buildPath('lifeCycle', 'status', 'value'),
56  Identifier::LIFECYCLE_CONTRIBUTE_ROLE => $this->buildPath('lifeCycle', 'contribute', 'role', 'value'),
57  Identifier::LIFECYCLE_CONTRIBUTE_PUBLISHER => $this->buildPath('lifeCycle', 'contribute', 'entity'),
58  Identifier::METAMETADATA_IDENTIFIER_CATALOG => $this->buildPath('metaMetadata', 'identifier', 'catalog'),
59  Identifier::METAMETADATA_CONTRIBUTE_ROLE => $this->buildPath('metaMetadata', 'contribute', 'role', 'value'),
60  Identifier::METAMETADATA_SCHEMA => $this->buildPath('metaMetadata', 'metadataSchema'),
61  Identifier::TECHNICAL_REQUIREMENT_TYPE => $this->buildPath('technical', 'requirement', 'orComposite', 'type', 'value'),
62  Identifier::TECHNICAL_REQUIREMENT_BROWSER, Identifier::TECHNICAL_REQUIREMENT_OS => $this->buildPath('technical', 'requirement', 'orComposite', 'name', 'value'),
63  Identifier::TECHNICAL_OTHER_PLATFORM_REQUIREMENTS => $this->buildPath('technical', 'otherPlatformRequirements', 'string'),
64  Identifier::TECHNICAL_FORMAT => $this->buildPath('technical', 'format'),
65  Identifier::EDUCATIONAL_INTERACTIVITY_TYPE => $this->buildPath('educational', 'interactivityType', 'value'),
66  Identifier::EDUCATIONAL_LEARNING_RESOURCE_TYPE => $this->buildPath('educational', 'learningResourceType', 'value'),
67  Identifier::EDUCATIONAL_INTERACTIVITY_LEVEL => $this->buildPath('educational', 'interactivityLevel', 'value'),
68  Identifier::EDUCATIONAL_SEMANTIC_DENSITY => $this->buildPath('educational', 'semanticDensity', 'value'),
69  Identifier::EDCUCATIONAL_INTENDED_END_USER_ROLE => $this->buildPath('educational', 'intendedEndUserRole', 'value'),
70  Identifier::EDUCATIONAL_CONTEXT => $this->buildPath('educational', 'context', 'value'),
71  Identifier::EDUCATIONAL_DIFFICULTY => $this->buildPath('educational', 'difficulty', 'value'),
72  Identifier::EDUCATIONAL_TYPICAL_AGE_RANGE => $this->buildPath('educational', 'typicalAgeRange', 'string'),
73  Identifier::RIGHTS_COST => $this->buildPath('rights', 'cost', 'value'),
74  Identifier::RIGHTS_CP_AND_OTHER_RESTRICTIONS => $this->buildPath('rights', 'copyrightAndOtherRestrictions', 'value'),
75  Identifier::RIGHTS_DESCRIPTION => $this->buildPath('rights', 'description', 'string'),
76  Identifier::RELATION_KIND => $this->buildPath('relation', 'kind', 'value'),
77  Identifier::RELATION_RESOURCE_IDENTIFIER_CATALOG => $this->buildPath('relation', 'resource', 'identifier', 'catalog'),
78  Identifier::CLASSIFICATION_PURPOSE => $this->buildPath('classification', 'purpose', 'value'),
79  Identifier::CLASSIFICATION_KEYWORD => $this->buildPath('classification', 'keyword', 'string'),
80  Identifier::CLASSIFICATION_TAXPATH_SOURCE => $this->buildPath('classification', 'taxonPath', 'source', 'string'),
81  Identifier::CLASSIFICATION_TAXON_ENTRY => $this->buildPath('classification', 'taxonPath', 'taxon', 'entry', 'string'),
82  Identifier::NULL => $this->buildPath()
83  };
84  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $navigator_factory

NavigatorFactoryInterface ILIAS\MetaData\Vocabularies\Slots\Handler::$navigator_factory
protected

Definition at line 35 of file Handler.php.

Referenced by ILIAS\MetaData\Vocabularies\Slots\Handler\__construct().

◆ $path_factory

PathFactory ILIAS\MetaData\Vocabularies\Slots\Handler::$path_factory
protected

Definition at line 34 of file Handler.php.

Referenced by ILIAS\MetaData\Vocabularies\Slots\Handler\__construct().

◆ $structure

StructureSetInterface ILIAS\MetaData\Vocabularies\Slots\Handler::$structure
protected

Definition at line 36 of file Handler.php.

Referenced by ILIAS\MetaData\Vocabularies\Slots\Handler\__construct().


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