ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Handler.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
26use ILIAS\Export\ExportHandler\I\Consumer\ExportWriter\HandlerInterface as ilExportHandlerConsumerExportWriterInterface;
27use ILIAS\Export\ExportHandler\I\Consumer\HandlerInterface as ilExportHandlerConsumerInterface;
28use ILIAS\Export\ExportHandler\I\FactoryInterface as ilExportHandlerFactoryInterface;
29use ILIAS\Export\ExportHandler\I\PublicAccess\HandlerInterface as ilExportHandlerPublicAccessInterface;
30use ILIAS\Export\ExportHandler\I\Repository\Element\HandlerInterface as ilExportHandlerRepositoryElementInterface;
31use ILIAS\Export\ExportHandler\I\Repository\Stakeholder\HandlerInterface as ExportRepositoryStakeholderInterface;
32use ilObject;
33
34class Handler implements ilExportHandlerConsumerInterface
35{
36 protected ilExportHandlerFactoryInterface $export_handler;
37
38 public function __construct(
39 ilExportHandlerFactoryInterface $export_handler
40 ) {
41 $this->export_handler = $export_handler;
42 }
43
44 public function publicAccess(): ilExportHandlerPublicAccessInterface
45 {
46 return $this->export_handler->publicAccess()->handler();
47 }
48
49 public function exportConfig(): ExportConfigFactoryInterface
50 {
51 return $this->export_handler->consumer()->exportConfig();
52 }
53
54 public function createStandardExport(
55 int $user_id,
56 ObjectId $object_id,
57 ExportConfigCollectionInterface $export_configs = null
58 ): ilExportHandlerRepositoryElementInterface {
59 $manager = $this->export_handler->manager()->handler();
60 if (is_null($export_configs)) {
61 $export_configs = $this->export_handler->consumer()->exportConfig()->allExportConfigs();
62 }
63 return $manager->createExport(
65 $manager->getExportInfo($object_id, time(), $export_configs),
66 ""
67 );
68 }
69
71 int $user_id,
72 ilObject $object,
73 ExportConfigCollectionInterface $export_configs = null
74 ): ilExportHandlerRepositoryElementInterface {
75 $manager = $this->export_handler->manager()->handler();
76 if (is_null($export_configs)) {
77 $export_configs = $this->export_handler->consumer()->exportConfig()->allExportConfigs();
78 }
79 return $manager->createExport(
81 $manager->getExportInfoWithObject($object, time(), $export_configs),
82 ""
83 );
84 }
85
86 public function exportWriter(
87 ilExportHandlerRepositoryElementInterface $element
88 ): ilExportHandlerConsumerExportWriterInterface {
89 return $this->export_handler->consumer()->exportWriter()->handler()
90 ->withObjectId($element->getKey()->getObjectId())
91 ->withResourceIdSerialized($element->getKey()->getResourceIdSerialized());
92 }
93
94 public function exportStakeholderHandler(): ExportRepositoryStakeholderInterface
95 {
96 return $this->export_handler->repository()->stakeholder()->handler();
97 }
98}
ilExportHandlerFactoryInterface $export_handler
Definition: Handler.php:36
exportWriter(ilExportHandlerRepositoryElementInterface $element)
Definition: Handler.php:86
__construct(ilExportHandlerFactoryInterface $export_handler)
Definition: Handler.php:38
createStandardExportByObject(int $user_id, ilObject $object, ExportConfigCollectionInterface $export_configs=null)
Definition: Handler.php:70
createStandardExport(int $user_id, ObjectId $object_id, ExportConfigCollectionInterface $export_configs=null)
Definition: Handler.php:54
Class ilObject Basic functions for all objects.
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...