39         $this->storage = $DIC->resourceStorage();
    44         $current_revision = $this->resource->getCurrentRevision();
    45         $current_revision->setTitle($new_title);
    46         $this->storage->manage()->updateRevision($current_revision);
    52     public function getFile(?
int $a_hist_entry_id = null): string
    54         $stream = $this->storage->consume()->stream($this->resource->getIdentification());
    55         if ($a_hist_entry_id) {
    56             $stream = $stream->setRevisionNumber($a_hist_entry_id);
    58         return $stream->getStream()->getMetadata(
'uri');
    63         return $this->resource->getCurrentRevision()->getInformation()->getTitle();
    68         return $this->resource->getCurrentRevision()->getInformation()->getSize() ?: 0;
    76         return $this->resource->getCurrentRevision()->getInformation()->getMimeType();
    81         $consumer = $this->storage->consume()->stream($this->resource->getIdentification());
    82         if ($a_version !== 0) {
    83             $consumer->setRevisionNumber($a_version);
    85         $stream = $consumer->getStream();
    87         return dirname($stream->getMetadata(
'uri'));
    90     public function sendFile(?
int $a_hist_entry_id = null, 
bool $inline = 
true): void
    93             $consumer = $this->storage->consume()->inline($this->resource->getIdentification());
    95             $consumer = $this->storage->consume()->download($this->resource->getIdentification());
    98         if ($a_hist_entry_id) {
    99             $revision = $this->resource->getSpecificRevision($a_hist_entry_id);
   100             $consumer->setRevisionNumber($a_hist_entry_id);
   102             $revision = $this->resource->getCurrentRevision();
   104         $consumer->overrideFileName($revision->getTitle());
   111         if (is_array($a_hist_entry_ids)) {
   112             foreach ($a_hist_entry_ids as 
$id) {
   113                 $this->storage->manage()->removeRevision($this->resource->getIdentification(), 
$id);
   120         return $this->resource->getCurrentRevision()->getInformation()->getSuffix();
   129         $current_revision = $this->resource->getCurrentRevisionIncludingDraft();
   130         foreach ($this->resource->getAllRevisionsIncludingDraft() as $revision) {
   131             if (is_array($version_ids) && !in_array($revision->getVersionNumber(), $version_ids)) {
   134             $information = $revision->getInformation();
   136             $v->setVersion($revision->getVersionNumber());
   137             $v->setHistEntryId($revision->getVersionNumber());
   138             $v->setFilename($information->getTitle());
   140                 $v->setAction(
'draft');
   142                 $version_number = $revision->getVersionNumber();
   143                 switch ($version_number) {
   145                         $v->setAction(
'create');
   147                     case $current_revision->getVersionNumber():
   148                         $v->setAction(
'published_version');
   151                         $v->setAction(
'intermediate_version');
   155             $v->setTitle($revision->getTitle());
   156             $v->setDate($information->getCreationDate()->format(DATE_ATOM));
   157             $v->setUserId($revision->getOwnerId() !== 0 ? $revision->getOwnerId() : 6);
   158             $v->setSize($information->getSize());
   168         return $this->resource->getStorageID();
   174             if ($inclduing_drafts) {
   175                 return $this->resource->getCurrentRevisionIncludingDraft()->getVersionNumber();
   177             return $this->resource->getCurrentRevision()->getVersionNumber();
   185         return $this->resource->getMaxRevision(
false);
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
getVersions(?array $version_ids=null)
 
Class ilObjFileImplementationStorage. 
 
Interface StorageResource. 
 
getVersion(bool $inclduing_drafts=false)
 
deleteVersions(?array $a_hist_entry_ids=null)
Deletes the specified history entries or all entries if no ids are specified. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
getFileExtension()
Returns the extension of the file name converted to lower-case. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
sendFile(?int $a_hist_entry_id=null, bool $inline=true)
 
getFile(?int $a_hist_entry_id=null)
 
__construct(protected StorableResource $resource)
ilObjFileImplementationStorage constructor. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
getDirectory(int $a_version=0)
 
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins 
 
handleChangedObjectTitle(string $new_title)