ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
LOMDictionary.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26
27use function PHPUnit\Framework\throwException;
28
29class LOMDictionary extends BaseDictionary implements DictionaryInterface
30{
31 public function tagForElement(
32 BaseElementInterface $element,
34 ): ?TagInterface {
35 foreach (parent::tagsForElement($element) as $tag) {
36 if (!($tag instanceof TagInterface)) {
37 throw new \ilMDXMLException('Invalid dictionary');
38 }
39 if ($tag->version() === $version) {
40 return $tag;
41 }
42 }
43 return null;
44 }
45}
$version
Definition: plugin.php:24
tagsForElement(BaseElementInterface $element)
If possible, takes into account the index of elements when finding tags (beginning with 0).
Definition: Dictionary.php:59
tagForElement(BaseElementInterface $element, Version $version)