ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ 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
use
ILIAS\MetaData\Vocabularies\Slots\Identifier
as
SlotIdentifier
;
29
30
class
Factory
31
{
32
protected
DataFactoryInterface
$data_factory
;
33
34
public
function
__construct
(
35
DataFactoryInterface
$data_factory
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
58
):
ElementInterface
{
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,
69
ElementInterface
$root
70
):
SetInterface
{
71
return
new
Set
(
72
$ressource_id,
73
$root
74
);
75
}
76
}
ILIAS\MetaData\Structure\Definitions\DefinitionInterface
Definition:
DefinitionInterface.php:25
ILIAS\MetaData\Elements\Factory\root
root(DefinitionInterface $definition, Element ... $sub_elements)
Definition:
Factory.php:55
DataFactoryInterface
ILIAS\MetaData\Elements\Factory\element
element(int $md_id, DefinitionInterface $definition, string $data_value, SlotIdentifier $vocab_slot=SlotIdentifier::NULL, Element ... $sub_elements)
Definition:
Factory.php:40
ILIAS\Data\Description\NULL
Definition:
ValueType.php:30
ILIAS\MetaData\Elements\Element
Definition:
Element.php:34
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:32
ILIAS\MetaData\Elements\SetInterface
Definition:
SetInterface.php:26
ILIAS\MetaData\Elements
Identifier
DefinitionInterface
ILIAS\MetaData\Structure\Definitions\DefinitionInterface\dataType
dataType()
Type of data this element can carry.
ILIAS\MetaData\Elements\Factory
Definition:
Factory.php:30
Element
ILIAS\MetaData\Elements\NoID
NoID
Definition:
NoID.php:23
ILIAS\MetaData\Elements\Data\DataFactoryInterface
Definition:
DataFactoryInterface.php:25
ILIAS\MetaData\Elements\Factory\__construct
__construct(DataFactoryInterface $data_factory)
Definition:
Factory.php:34
components
ILIAS
MetaData
classes
Elements
Factory.php
Generated on Sun Aug 31 2025 23:01:52 for ILIAS by
1.8.13 (using
Doxyfile
)