ILIAS
trunk Revision v11.0_alpha-2645-g16283d3b3f8
◀ ilDoc Overview
Derivator.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
26
class
Derivator
implements
DerivatorInterface
27
{
28
protected
SetInterface
$from_set
;
29
protected
RepositoryInterface
$repository
;
30
31
public
function
__construct
(
32
SetInterface
$from_set,
33
RepositoryInterface
$repository
34
) {
35
$this->from_set =
$from_set
;
36
$this->
repository
=
$repository
;
37
}
38
42
public
function
forObject
(
int
$obj_id,
int
$sub_id,
string
$type): void
43
{
44
if
($sub_id === 0) {
45
$sub_id = $obj_id;
46
}
47
48
try
{
49
$this->
repository
->transferMD(
50
$this->from_set,
51
$obj_id,
52
$sub_id,
53
$type,
54
true
55
);
56
}
catch
(\
ilMDRepositoryException
$e
) {
57
throw
new \ilMDServicesException(
58
'Failed to derive LOM set: '
. $e->getMessage()
59
);
60
}
61
}
62
}
ILIAS\MetaData\Services\Derivation\Derivator
Definition:
Derivator.php:26
ILIAS\MetaData\Services\Derivation\Derivator\__construct
__construct(SetInterface $from_set, RepositoryInterface $repository)
Definition:
Derivator.php:31
ILIAS\UI\examples\Deck\repository
repository()
description: > Example for rendering a repository card
Definition:
repository.php:33
ILIAS\MetaData\Services\Derivation\Derivator\$repository
RepositoryInterface $repository
Definition:
Derivator.php:29
Vendor\Package\$e
$e
Definition:
example_cleaned.php:49
ILIAS\MetaData\Services\Derivation\Derivator\$from_set
SetInterface $from_set
Definition:
Derivator.php:28
ILIAS\MetaData\Services\Derivation\Derivator\forObject
forObject(int $obj_id, int $sub_id, string $type)
Definition:
Derivator.php:42
ILIAS\MetaData\Services\Derivation
ILIAS\MetaData\Services\Derivation\DerivatorInterface
Definition:
DerivatorInterface.php:23
SetInterface
ilMDRepositoryException
Definition:
class.ilMDRepositoryException.php:21
ILIAS\MetaData\Elements\SetInterface
Definition:
SetInterface.php:26
RepositoryInterface
ILIAS\MetaData\Repository\RepositoryInterface
Definition:
RepositoryInterface.php:29
components
ILIAS
MetaData
classes
Services
Derivation
Derivator.php
Generated on Mon Sep 1 2025 23:03:33 for ILIAS by
1.8.13 (using
Doxyfile
)