51 ?
string $title =
null,
52 ?
string $description =
null,
53 ?
string $copyright_id =
null,
54 bool $create_reference =
false 56 $revision = $this->storage->manage()->getCurrentRevision($rid);
58 $file_obj->setResourceId($rid);
59 if ($this->page_counter->isAvailable()) {
60 $file_obj->setPageCount($this->page_counter->extractAmountOfPagesByRID($rid) ?? 0);
63 $file_name = $revision->getInformation()->getTitle();
64 $title = $file_obj->appendSuffixToTitle(
69 $revision->setTitle($title);
70 $this->storage->manage()->updateRevision($revision);
72 if (!$this->policy->isValidExtension($revision->getInformation()->getSuffix())) {
73 $this->invalid_file_names[] = $title;
75 $file_obj->setTitle($title);
76 if ($description !==
null) {
77 $file_obj->setDescription($description);
79 $file_obj->setVersion($revision->getVersionNumber());
80 $file_obj->setCopyrightID($copyright_id);
84 if ($create_reference) {
85 $file_obj->createReference();
88 $file_obj->processAutoRating();
89 $this->gui_object->putObjectInTree($file_obj, $parent_id);
Class ilFileServicesPolicy.
Interface ilObjFileProcessorInterface.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(protected ResourceStakeholder $stakeholder, protected ilObjFileGUI $gui_object, protected Services $storage, protected ilFileServicesSettings $settings)
ilCountPDFPages $page_counter
Class ResourceIdentification.
array $invalid_file_names
Class ilObjFileAbstractProcessorInterface.
GUI class for file objects.
ilFileServicesPolicy $policy
Interface ResourceStakeholder.
createFileObj(ResourceIdentification $rid, int $parent_id, ?string $title=null, ?string $description=null, ?string $copyright_id=null, bool $create_reference=false)
Creates an ilObjFile instance for the provided information.