ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Set.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\MetaData\Elements;
22 
25 
26 class Set extends BaseSet implements SetInterface
27 {
29 
30  public function __construct(
31  RessourceIDInterface $ressource_id,
33  ) {
34  parent::__construct($root);
35  $this->ressource_id = $ressource_id;
36  }
37 
39  {
40  return $this->ressource_id;
41  }
42 
43  public function getRoot(): ElementInterface
44  {
45  $root = parent::getRoot();
46  if ($root instanceof ElementInterface) {
47  return $root;
48  }
49  throw new \ilMDElementsException(
50  'Metadata set has invalid root element.'
51  );
52  }
53 }
RessourceIDInterface $ressource_id
Definition: Set.php:28
getRessourceID()
Contains the information needed to identify the ILIAS object this metadata set belongs to...
Definition: Set.php:38
getRoot()
Returns the root element of the metadata set.
Definition: Set.php:43
__construct(RessourceIDInterface $ressource_id, ElementInterface $root)
Definition: Set.php:30
__construct(Container $dic, ilPlugin $plugin)
BaseElementInterface $root
Definition: BaseSet.php:25