ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Exercise\InstructionFile\InstructionFileManager Class Reference
+ Collaboration diagram for ILIAS\Exercise\InstructionFile\InstructionFileManager:

Public Member Functions

 __construct (int $ass_id, InstructionFileRepository $repo, \ilExcInstructionFilesStakeholder $stakeholder)
 
 getStakeholder ()
 
 getCollectionIdString ()
 
 createCollection ()
 
 importFromLegacyUpload (array $file_input)
 
 importFromDirectory (string $dir)
 
 deleteCollection ()
 
 getCollection ()
 
 getFiles ()
 
 deliver (string $full_path, string $file)
 
 getStream (string $rid)
 
 cloneTo (int $to_ass_id)
 

Protected Attributes

ilExcInstructionFilesStakeholder $stakeholder
 
ILIAS FileUpload FileUpload $upload
 
int $ass_id
 
InstructionFileRepository $repo
 

Detailed Description

Definition at line 28 of file InstructionFileManager.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Exercise\InstructionFile\InstructionFileManager::__construct ( int  $ass_id,
InstructionFileRepository  $repo,
\ilExcInstructionFilesStakeholder  $stakeholder 
)

Member Function Documentation

◆ cloneTo()

ILIAS\Exercise\InstructionFile\InstructionFileManager::cloneTo ( int  $to_ass_id)

Definition at line 126 of file InstructionFileManager.php.

128 : void {
129 $this->repo->clone($this->ass_id, $to_ass_id);
130 }

◆ createCollection()

ILIAS\Exercise\InstructionFile\InstructionFileManager::createCollection ( )

Definition at line 59 of file InstructionFileManager.php.

59 : void
60 {
61 $this->repo->createCollection($this->ass_id);
62 }

◆ deleteCollection()

ILIAS\Exercise\InstructionFile\InstructionFileManager::deleteCollection ( )

Definition at line 82 of file InstructionFileManager.php.

82 : void
83 {
84 $this->repo->deleteCollection(
85 $this->ass_id,
86 $this->stakeholder
87 );
88 }

◆ deliver()

ILIAS\Exercise\InstructionFile\InstructionFileManager::deliver ( string  $full_path,
string  $file 
)

Definition at line 113 of file InstructionFileManager.php.

113 : void
114 {
115 if ($this->repo->hasCollection($this->ass_id)) {
116 $this->repo->deliverFile($this->ass_id, $file);
117 }
118 }

◆ getCollection()

ILIAS\Exercise\InstructionFile\InstructionFileManager::getCollection ( )

Definition at line 90 of file InstructionFileManager.php.

90 : ?ResourceCollection
91 {
92 return $this->repo->getCollection($this->ass_id);
93 }

◆ getCollectionIdString()

ILIAS\Exercise\InstructionFile\InstructionFileManager::getCollectionIdString ( )

Definition at line 54 of file InstructionFileManager.php.

54 : string
55 {
56 return $this->repo->getIdStringForAssId($this->ass_id);
57 }

◆ getFiles()

ILIAS\Exercise\InstructionFile\InstructionFileManager::getFiles ( )

Definition at line 95 of file InstructionFileManager.php.

95 : array
96 {
97 if ($this->repo->hasCollection($this->ass_id)) {
98 return array_map(function (ResourceInformation $info): array {
99 return [
100 'rid' => $info->getRid(),
101 'name' => $info->getTitle(),
102 'size' => $info->getSize(),
103 'ctime' => $info->getCreationTimestamp(),
104 'fullpath' => $info->getSrc(),
105 'mime' => $info->getMimeType(), // this is additional to still use the image delivery in class.ilExAssignmentGUI.php:306
106 'order' => 0 // sorting is currently not supported
107 ];
108 }, iterator_to_array($this->repo->getCollectionResourcesInfo($this->ass_id)));
109 }
110 return [];
111 }
$info
Definition: entry_point.php:21

References $info.

◆ getStakeholder()

ILIAS\Exercise\InstructionFile\InstructionFileManager::getStakeholder ( )

Definition at line 49 of file InstructionFileManager.php.

49 : ResourceStakeholder
50 {
51 return $this->stakeholder;
52 }

References ILIAS\Exercise\InstructionFile\InstructionFileManager\$stakeholder.

◆ getStream()

ILIAS\Exercise\InstructionFile\InstructionFileManager::getStream ( string  $rid)

Definition at line 120 of file InstructionFileManager.php.

122 : ?FileStream {
123 return $this->repo->getStream($this->ass_id, $rid);
124 }

◆ importFromDirectory()

ILIAS\Exercise\InstructionFile\InstructionFileManager::importFromDirectory ( string  $dir)

Definition at line 73 of file InstructionFileManager.php.

73 : void
74 {
75 $this->repo->importFromDirectory(
76 $this->ass_id,
77 $dir,
78 $this->stakeholder
79 );
80 }

◆ importFromLegacyUpload()

ILIAS\Exercise\InstructionFile\InstructionFileManager::importFromLegacyUpload ( array  $file_input)

Definition at line 64 of file InstructionFileManager.php.

64 : void
65 {
66 $this->repo->importFromLegacyUpload(
67 $this->ass_id,
68 $file_input,
69 $this->stakeholder
70 );
71 }

Field Documentation

◆ $ass_id

int ILIAS\Exercise\InstructionFile\InstructionFileManager::$ass_id
protected

◆ $repo

InstructionFileRepository ILIAS\Exercise\InstructionFile\InstructionFileManager::$repo
protected

◆ $stakeholder

ilExcInstructionFilesStakeholder ILIAS\Exercise\InstructionFile\InstructionFileManager::$stakeholder
protected

◆ $upload

ILIAS FileUpload FileUpload ILIAS\Exercise\InstructionFile\InstructionFileManager::$upload
protected

Definition at line 31 of file InstructionFileManager.php.


The documentation for this class was generated from the following file: