ILIAS  trunk Revision v11.0_alpha-1866-gfa368f7776e
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Writer.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
25 
26 class Writer implements WriterInterface
27 {
29  protected SimpleDCXMLWriter $xml_writer;
30 
31  public function __construct(
32  LOMRepository $lom_repository,
33  SimpleDCXMLWriter $xml_writer
34  ) {
35  $this->lom_repository = $lom_repository;
36  $this->xml_writer = $xml_writer;
37  }
38 
39  public function writeSimpleDCMetaData(int $obj_id, int $ref_id, string $type): \DOMDocument
40  {
41  $simple_dc_xml = new \DOMDocument();
42  $simple_dc_xml->loadXML($this->xml_writer->write(
43  $this->lom_repository->getMD($obj_id, $obj_id, $type),
44  $ref_id
45  )->asXML());
46  return $simple_dc_xml;
47  }
48 }
__construct(LOMRepository $lom_repository, SimpleDCXMLWriter $xml_writer)
Definition: Writer.php:31
$ref_id
Definition: ltiauth.php:65
writeSimpleDCMetaData(int $obj_id, int $ref_id, string $type)
Definition: Writer.php:39