ILIAS
release_9 Revision v9.13-25-g2c18ec4c24f
◀ ilDoc Overview
Factory.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\MetaData\Elements
;
22
23
use
ILIAS\MetaData\Elements\Element
;
24
use
ILIAS\MetaData\Elements\Data\DataFactoryInterface
;
25
use
ILIAS\MetaData\Elements\NoID
;
26
use
ILIAS\MetaData\Structure\Definitions\DefinitionInterface
;
27
use
ILIAS\MetaData\Elements\RessourceID\RessourceIDInterface
;
28
29
class
Factory
30
{
31
protected
DataFactoryInterface
$data_factory
;
32
33
public
function
__construct
(
34
DataFactoryInterface
$data_factory
35
) {
36
$this->data_factory =
$data_factory
;
37
}
38
39
public
function
element
(
40
int
$md_id,
41
DefinitionInterface
$definition,
42
string
$data_value,
43
Element
...$sub_elements
44
):
Element
{
45
return
new
Element
(
46
$md_id,
47
$definition,
48
$this->data_factory->data($definition->
dataType
(), $data_value),
49
...$sub_elements
50
);
51
}
52
53
public
function
root
(
54
DefinitionInterface
$definition,
55
Element
...$sub_elements
56
):
ElementInterface
{
57
return
new
Element
(
58
NoID::ROOT,
59
$definition,
60
$this->data_factory->null(),
61
...$sub_elements
62
);
63
}
64
65
public
function
set
(
66
RessourceIDInterface
$ressource_id,
67
ElementInterface
$root
68
):
SetInterface
{
69
return
new
Set
(
70
$ressource_id,
71
$root
72
);
73
}
74
}
ILIAS\MetaData\Structure\Definitions\DefinitionInterface
Definition:
DefinitionInterface.php:25
ILIAS\MetaData\Elements\Factory\root
root(DefinitionInterface $definition, Element ... $sub_elements)
Definition:
Factory.php:53
DataFactoryInterface
ILIAS\MetaData\Elements\Element
Definition:
Element.php:34
Factory
RessourceIDInterface
ILIAS\MetaData\Elements\ElementInterface
Definition:
ElementInterface.php:28
ILIAS\MetaData\Elements\Set
Definition:
Set.php:26
ILIAS\MetaData\Elements\RessourceID\RessourceIDInterface
Definition:
RessourceIDInterface.php:23
ILIAS\MetaData\Elements\Factory\$data_factory
DataFactoryInterface $data_factory
Definition:
Factory.php:31
ILIAS\MetaData\Elements\SetInterface
Definition:
SetInterface.php:26
ILIAS\MetaData\Elements
ILIAS\MetaData\Elements\Factory\element
element(int $md_id, DefinitionInterface $definition, string $data_value, Element ... $sub_elements)
Definition:
Factory.php:39
DefinitionInterface
ILIAS\MetaData\Structure\Definitions\DefinitionInterface\dataType
dataType()
Type of data this element can carry.
Element
ILIAS\MetaData\Elements\NoID
NoID
Definition:
NoID.php:23
ILIAS\MetaData\Elements\Data\DataFactoryInterface
Definition:
DataFactoryInterface.php:23
ILIAS\MetaData\Elements\Factory\__construct
__construct(DataFactoryInterface $data_factory)
Definition:
Factory.php:33
Services
MetaData
classes
Elements
Factory.php
Generated on Wed Sep 10 2025 14:11:40 for ILIAS by
1.8.13 (using
Doxyfile
)