ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Derivator.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
25
27{
30
31 public function __construct(
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}
__construct(SetInterface $from_set, RepositoryInterface $repository)
Definition: Derivator.php:31
forObject(int $obj_id, int $sub_id, string $type)
Definition: Derivator.php:42