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

Public Member Functions

 __construct (IRSSWrapper $wrapper, \ilDBInterface $db)
 
 createCollection (int $ass_id)
 
 getIdStringForAssId (int $ass_id)
 
 hasCollection (int $ass_id)
 
 getCollection (int $ass_id)
 
 importFromLegacyUpload (int $ass_id, array $file_input, ResourceStakeholder $stakeholder)
 
 importFromDirectory (int $ass_id, string $dir, ResourceStakeholder $stakeholder)
 
 getCollectionResourcesInfo (int $ass_id)
 
 deleteCollection (int $ass_id, ResourceStakeholder $stakeholder)
 
 clone (int $from_ass_id, int $to_ass_id)
 

Protected Attributes

IRSSWrapper $wrapper
 
ilDBInterface $db
 

Detailed Description

Definition at line 29 of file InstructionFileRepository.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Exercise\InstructionFile\InstructionFileRepository::__construct ( IRSSWrapper  $wrapper,
\ilDBInterface  $db 
)

Member Function Documentation

◆ clone()

ILIAS\Exercise\InstructionFile\InstructionFileRepository::clone ( int  $from_ass_id,
int  $to_ass_id 
)

Definition at line 158 of file InstructionFileRepository.php.

161 : void {
162 $from_rcid = $this->getIdStringForAssId($from_ass_id);
163 $to_rcid = $this->wrapper->clone($from_rcid);
164 if ($to_rcid !== "") {
165 $this->db->update(
166 "exc_assignment",
167 [
168 "if_rcid" => ["text", $to_rcid]
169 ],
170 [ // where
171 "id" => ["integer", $to_ass_id]
172 ]
173 );
174 }
175 }

◆ createCollection()

ILIAS\Exercise\InstructionFile\InstructionFileRepository::createCollection ( int  $ass_id)

Definition at line 42 of file InstructionFileRepository.php.

42 : void
43 {
44 $new_id = $this->wrapper->createEmptyCollection();
45 $this->db->update(
46 "exc_assignment",
47 [
48 "if_rcid" => ["text", $new_id]
49 ],
50 [ // where
51 "id" => ["integer", $ass_id]
52 ]
53 );
54 }

References $ass_id.

◆ deleteCollection()

ILIAS\Exercise\InstructionFile\InstructionFileRepository::deleteCollection ( int  $ass_id,
ResourceStakeholder  $stakeholder 
)

Definition at line 144 of file InstructionFileRepository.php.

147 : void {
148 $rcid = $this->getIdStringForAssId($ass_id);
149 if ($rcid === "") {
150 return;
151 }
152 $this->wrapper->deleteCollectionForIdString(
153 $rcid,
154 $stakeholder
155 );
156 }

◆ getCollection()

ILIAS\Exercise\InstructionFile\InstructionFileRepository::getCollection ( int  $ass_id)

Definition at line 74 of file InstructionFileRepository.php.

74 : ?ResourceCollection
75 {
76 $rcid = $this->getIdStringForAssId($ass_id);
77 if ($rcid !== "") {
78 return $this->wrapper->getCollectionForIdString($rcid);
79 }
80 return null;
81 }

References ILIAS\Exercise\InstructionFile\InstructionFileRepository\getIdStringForAssId().

+ Here is the call graph for this function:

◆ getCollectionResourcesInfo()

ILIAS\Exercise\InstructionFile\InstructionFileRepository::getCollectionResourcesInfo ( int  $ass_id)

Definition at line 137 of file InstructionFileRepository.php.

139 : \Generator {
140 $collection = $this->getCollection($ass_id);
141 return $this->wrapper->getCollectionResourcesInfo($collection);
142 }

◆ getIdStringForAssId()

ILIAS\Exercise\InstructionFile\InstructionFileRepository::getIdStringForAssId ( int  $ass_id)

Definition at line 56 of file InstructionFileRepository.php.

56 : string
57 {
58 $set = $this->db->queryF(
59 "SELECT if_rcid FROM exc_assignment " .
60 " WHERE id = %s ",
61 ["integer"],
62 [$ass_id]
63 );
64 $rec = $this->db->fetchAssoc($set);
65 return ($rec["if_rcid"] ?? "");
66 }

References $ass_id.

Referenced by ILIAS\Exercise\InstructionFile\InstructionFileRepository\getCollection(), and ILIAS\Exercise\InstructionFile\InstructionFileRepository\hasCollection().

+ Here is the caller graph for this function:

◆ hasCollection()

ILIAS\Exercise\InstructionFile\InstructionFileRepository::hasCollection ( int  $ass_id)

Definition at line 68 of file InstructionFileRepository.php.

68 : bool
69 {
70 $rcid = $this->getIdStringForAssId($ass_id);
71 return ($rcid !== "");
72 }

References ILIAS\Exercise\InstructionFile\InstructionFileRepository\getIdStringForAssId().

+ Here is the call graph for this function:

◆ importFromDirectory()

ILIAS\Exercise\InstructionFile\InstructionFileRepository::importFromDirectory ( int  $ass_id,
string  $dir,
ResourceStakeholder  $stakeholder 
)

Definition at line 98 of file InstructionFileRepository.php.

102 : void {
103 $collection = $this->getCollection($ass_id);
104 if ($collection) {
105 $this->wrapper->importFilesFromDirectoryToCollection(
106 $collection,
107 $dir,
108 $stakeholder
109 );
110 }
111 }

◆ importFromLegacyUpload()

ILIAS\Exercise\InstructionFile\InstructionFileRepository::importFromLegacyUpload ( int  $ass_id,
array  $file_input,
ResourceStakeholder  $stakeholder 
)

Definition at line 83 of file InstructionFileRepository.php.

87 : void {
88 $collection = $this->getCollection($ass_id);
89 if ($collection) {
90 $this->wrapper->importFilesFromLegacyUploadToCollection(
91 $collection,
92 $file_input,
93 $stakeholder
94 );
95 }
96 }

Field Documentation

◆ $db

ilDBInterface ILIAS\Exercise\InstructionFile\InstructionFileRepository::$db
protected

◆ $wrapper

IRSSWrapper ILIAS\Exercise\InstructionFile\InstructionFileRepository::$wrapper
protected

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