ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilObjBibliographicUploadHandlerGUI.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
24 
30 {
31  public function __construct(private string $rid = "")
32  {
34  }
35 
36  #[\Override]
37  protected function getUploadResult(): HandlerResult
38  {
39  $this->upload->process();
40 
41  $result_array = $this->upload->getResults();
42  $result = end($result_array);
43 
44  if ($result instanceof UploadResult && $result->isOK()) {
45  $resource_identification = $this->storage->manage()->find($this->rid);
46  if ($resource_identification !== null) {
47  $identifier = $this->storage->manage()->replaceWithUpload(
48  $resource_identification,
49  $result,
50  $this->stakeholder
51  )->getIdentification()->serialize();
52  } else {
53  $identifier = $this->storage->manage()->upload($result, $this->stakeholder)->serialize();
54  }
55  $status = HandlerResult::STATUS_OK;
56  $message = "file upload OK";
57  } else {
58  $identifier = '';
59  $status = HandlerResult::STATUS_FAILED;
60  $message = $result->getStatus()->getMessage();
61  }
62 
63  return new BasicHandlerResult(
65  $status,
66  $identifier,
67  $message
68  );
69  }
70 }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Class ilObjBibliographicStakeholder.
Class ilCtrlAwareStorageUploadHandler.
__construct(Container $dic, ilPlugin $plugin)
$message
Definition: xapiexit.php:31