ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
SourceSelector.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26
28{
31
32 public function __construct(
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 = ''
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}
__construct(RepositoryInterface $repository, CreatorInterface $creator)
fromBasicProperties(string $title, string $description='', string $language='')
fromObject(int $obj_id, int $sub_id, string $type)
Choose an ILIAS object as the source.
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...