ILIAS
trunk Revision v11.0_alpha-2658-ge2404539063
◀ ilDoc Overview
Builder.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\MetaData\Vocabularies\Factory
;
22
23
use
ILIAS\MetaData\Vocabularies\Slots\Identifier
as
SlotIdentifier
;
24
use
ILIAS\MetaData\Vocabularies\Vocabulary
;
25
use
ILIAS\MetaData\Vocabularies\Type
;
26
use
ILIAS\MetaData\Vocabularies\VocabularyInterface
;
27
28
class
Builder
implements
BuilderInterface
29
{
30
protected
SlotIdentifier
$slot
;
31
protected
Type
$type
;
32
protected
string
$id
;
33
protected
string
$source
;
34
38
protected
array
$values
;
39
protected
bool
$is_active
=
true
;
40
protected
bool
$allows_custom_inputs
=
true
;
41
42
public
function
__construct
(
43
SlotIdentifier
$slot,
44
Type
$type,
45
string
$id,
46
string
$source,
47
string
...$values
48
) {
49
$this->slot =
$slot
;
50
$this->type =
$type
;
51
$this->
id
=
$id
;
52
$this->source =
$source
;
53
$this->values =
$values
;
54
}
55
56
public
function
withIsDeactivated
(
bool
$deactivated =
true
):
BuilderInterface
57
{
58
$clone = clone $this;
59
$clone->is_active = !$deactivated;
60
return
$clone;
61
}
62
63
public
function
withDisallowsCustomInputs
(
bool
$no_custom_inputs =
true
):
BuilderInterface
64
{
65
$clone = clone $this;
66
$clone->allows_custom_inputs = !$no_custom_inputs;
67
return
$clone;
68
}
69
70
public
function
get
():
VocabularyInterface
71
{
72
return
new
Vocabulary
(
73
$this->slot,
74
$this->type,
75
$this->
id
,
76
$this->source,
77
$this->is_active,
78
$this->allows_custom_inputs,
79
...$this->values
80
);
81
}
82
}
ILIAS\MetaData\Vocabularies\Factory\Builder
Definition:
Builder.php:28
Vocabulary
ILIAS\MetaData\Vocabularies\Factory\Builder\$allows_custom_inputs
bool $allows_custom_inputs
Definition:
Builder.php:40
ILIAS\MetaData\Vocabularies\Factory\Builder\$type
Type $type
Definition:
Builder.php:31
ILIAS\MetaData\Vocabularies\Factory\Builder\$id
string $id
Definition:
Builder.php:32
ILIAS\MetaData\Vocabularies\Factory\Builder\withIsDeactivated
withIsDeactivated(bool $deactivated=true)
Definition:
Builder.php:56
ILIAS\MetaData\Vocabularies\Factory\Builder\$slot
SlotIdentifier $slot
Definition:
Builder.php:30
ILIAS\MetaData\Vocabularies\Factory\Builder\$values
array $values
Definition:
Builder.php:38
ILIAS\MetaData\Vocabularies\Factory
Definition:
Builder.php:21
ILIAS\MetaData\Vocabularies\Factory\Builder\$source
string $source
Definition:
Builder.php:33
ILIAS\MetaData\Vocabularies\Factory\Builder\__construct
__construct(SlotIdentifier $slot, Type $type, string $id, string $source, string ... $values)
Definition:
Builder.php:42
ILIAS\MetaData\Vocabularies\VocabularyInterface
Definition:
VocabularyInterface.php:25
Identifier
ILIAS\MetaData\Vocabularies\Factory\Builder\$is_active
bool $is_active
Definition:
Builder.php:39
VocabularyInterface
ILIAS\MetaData\Vocabularies\Type
Type
Definition:
Type.php:23
ILIAS\MetaData\Vocabularies\Factory\Builder\withDisallowsCustomInputs
withDisallowsCustomInputs(bool $no_custom_inputs=true)
Definition:
Builder.php:63
ILIAS\MetaData\Vocabularies\Factory\BuilderInterface
Definition:
BuilderInterface.php:26
ILIAS\MetaData\Vocabularies\Vocabulary
Definition:
Vocabulary.php:25
components
ILIAS
MetaData
classes
Vocabularies
Factory
Builder.php
Generated on Tue Sep 2 2025 23:02:33 for ILIAS by
1.8.13 (using
Doxyfile
)