ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Factory.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
29
31{
33
34 public function __construct(
36 ) {
37 $this->data_factory = $data_factory;
38 }
39
40 public function element(
41 int $md_id,
42 DefinitionInterface $definition,
43 string $data_value,
44 SlotIdentifier $vocab_slot = SlotIdentifier::NULL,
45 Element ...$sub_elements
46 ): Element {
47 return new Element(
48 $md_id,
49 $definition,
50 $this->data_factory->data($definition->dataType(), $data_value, $vocab_slot),
51 ...$sub_elements
52 );
53 }
54
55 public function root(
56 DefinitionInterface $definition,
57 Element ...$sub_elements
59 return new Element(
60 NoID::ROOT,
61 $definition,
62 $this->data_factory->null(),
63 ...$sub_elements
64 );
65 }
66
67 public function set(
68 RessourceIDInterface $ressource_id,
70 ): SetInterface {
71 return new Set(
72 $ressource_id,
73 $root
74 );
75 }
76}
__construct(DataFactoryInterface $data_factory)
Definition: Factory.php:34
DataFactoryInterface $data_factory
Definition: Factory.php:32
element(int $md_id, DefinitionInterface $definition, string $data_value, SlotIdentifier $vocab_slot=SlotIdentifier::NULL, Element ... $sub_elements)
Definition: Factory.php:40
root(DefinitionInterface $definition, Element ... $sub_elements)
Definition: Factory.php:55
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...