ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
LOMDictionary.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25
27
28use function PHPUnit\Framework\throwException;
29
30class LOMDictionary extends BaseDictionary implements DictionaryInterface
31{
32 public function tagForElement(
33 BaseElementInterface $element,
35 ): ?TagInterface {
36 foreach (parent::tagsForElement($element) as $tag) {
37 if (!($tag instanceof TagInterface)) {
38 throw new \ilMDXMLException('Invalid dictionary');
39 }
40 if ($tag->version() === $version) {
41 return $tag;
42 }
43 }
44 return null;
45 }
46}
$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)