ILIAS
trunk Revision v11.0_alpha-2645-g16283d3b3f8
◀ ilDoc Overview
SourceSelector.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\MetaData\Services\Derivation
;
22
23
use
ILIAS\MetaData\Repository\RepositoryInterface
;
24
use
ILIAS\MetaData\Elements\SetInterface
;
25
use
ILIAS\MetaData\Services\Derivation\Creation\CreatorInterface
;
26
27
class
SourceSelector
implements
SourceSelectorInterface
28
{
29
protected
RepositoryInterface
$repository
;
30
protected
CreatorInterface
$creator
;
31
32
public
function
__construct
(
33
RepositoryInterface
$repository,
34
CreatorInterface
$creator
35
) {
36
$this->
repository
=
$repository
;
37
$this->creator =
$creator
;
38
}
39
40
public
function
fromObject
(
int
$obj_id,
int
$sub_id,
string
$type):
DerivatorInterface
41
{
42
if
($sub_id === 0) {
43
$sub_id = $obj_id;
44
}
45
46
return
$this->
getDerivator
(
47
$this->
repository
->getMD($obj_id, $sub_id, $type)
48
);
49
}
50
54
public
function
fromBasicProperties
(
55
string
$title,
56
string
$description =
''
,
57
string
$language =
''
58
):
DerivatorInterface
{
59
return
$this->
getDerivator
(
60
$this->creator->createSet($title, $description, $language)
61
);
62
}
63
64
protected
function
getDerivator
(
SetInterface
$from_set):
DerivatorInterface
65
{
66
return
new
Derivator
(
67
$from_set,
68
$this->
repository
69
);
70
}
71
}
ILIAS\MetaData\Services\Derivation\Derivator
Definition:
Derivator.php:26
ILIAS\MetaData\Services\Derivation\SourceSelector\getDerivator
getDerivator(SetInterface $from_set)
Definition:
SourceSelector.php:64
ILIAS\UI\examples\Deck\repository
repository()
description: > Example for rendering a repository card
Definition:
repository.php:33
ILIAS\MetaData\Services\Derivation\SourceSelector\fromObject
fromObject(int $obj_id, int $sub_id, string $type)
Choose an ILIAS object as the source.
Definition:
SourceSelector.php:40
ILIAS\MetaData\Services\Derivation\SourceSelector\$creator
CreatorInterface $creator
Definition:
SourceSelector.php:30
ILIAS\MetaData\Services\Derivation\SourceSelector\$repository
RepositoryInterface $repository
Definition:
SourceSelector.php:29
ILIAS\MetaData\Services\Derivation\SourceSelector
Definition:
SourceSelector.php:27
ILIAS\MetaData\Services\Derivation
ILIAS\MetaData\Services\Derivation\DerivatorInterface
Definition:
DerivatorInterface.php:23
SetInterface
ILIAS\MetaData\Services\Derivation\SourceSelectorInterface
Definition:
SourceSelectorInterface.php:23
ILIAS\MetaData\Services\Derivation\Creation\CreatorInterface
Definition:
CreatorInterface.php:25
ILIAS\MetaData\Elements\SetInterface
Definition:
SetInterface.php:26
RepositoryInterface
ILIAS\MetaData\Services\Derivation\SourceSelector\fromBasicProperties
fromBasicProperties(string $title, string $description='', string $language='')
Definition:
SourceSelector.php:54
CreatorInterface
ILIAS\MetaData\Repository\RepositoryInterface
Definition:
RepositoryInterface.php:29
ILIAS\MetaData\Services\Derivation\SourceSelector\__construct
__construct(RepositoryInterface $repository, CreatorInterface $creator)
Definition:
SourceSelector.php:32
components
ILIAS
MetaData
classes
Services
Derivation
SourceSelector.php
Generated on Mon Sep 1 2025 23:03:33 for ILIAS by
1.8.13 (using
Doxyfile
)