ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
LOMDatabaseRepository.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
32 
34 {
40 
41  public function __construct(
42  RessourceIDFactoryInterface $ressource_factory,
43  ScaffoldProviderInterface $scaffold_provider,
44  DatabaseManipulatorInterface $manipulator,
46  CleanerInterface $cleaner
47  ) {
48  $this->ressource_factory = $ressource_factory;
49  $this->scaffold_provider = $scaffold_provider;
50  $this->manipulator = $manipulator;
51  $this->reader = $reader;
52  $this->cleaner = $cleaner;
53  }
54 
55  public function getMD(
56  int $obj_id,
57  int $sub_id,
58  string $type
59  ): SetInterface {
60  return $this->cleaner->clean(
61  $this->reader->getMD(
62  $this->ressource_factory->ressourceID($obj_id, $sub_id, $type)
63  )
64  );
65  }
66 
67  public function getMDOnPath(
69  int $obj_id,
70  int $sub_id,
71  string $type
72  ): SetInterface {
73  return $this->cleaner->clean(
74  $this->reader->getMDOnPath(
75  $path,
76  $this->ressource_factory->ressourceID($obj_id, $sub_id, $type)
77  )
78  );
79  }
80 
85  {
87  }
88 
89  public function manipulateMD(SetInterface $set): void
90  {
91  $this->cleaner->checkMarkers($set);
92  $this->manipulator->manipulateMD($set);
93  }
94 
95  public function deleteAllMD(
96  int $obj_id,
97  int $sub_id,
98  string $type
99  ): void {
100  $this->manipulator->deleteAllMD(
101  $this->ressource_factory->ressourceID($obj_id, $sub_id, $type)
102  );
103  }
104 }
__construct(RessourceIDFactoryInterface $ressource_factory, ScaffoldProviderInterface $scaffold_provider, DatabaseManipulatorInterface $manipulator, DatabaseReaderInterface $reader, CleanerInterface $cleaner)
getMDOnPath(PathInterface $path, int $obj_id, int $sub_id, string $type)
Returns an MD set with only the elements specified on a path, and all nested subelements of the last ...
getMD(int $obj_id, int $sub_id, string $type)
deleteAllMD(int $obj_id, int $sub_id, string $type)
$path
Definition: ltiservices.php:32
manipulateMD(SetInterface $set)
Follows a trail of markers from the root element, and creates, updates or deletes marked MD elements ...