ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ILIAS\Exercise\InstructionFile\InstructionFileRepository Class Reference
+ Collaboration diagram for ILIAS\Exercise\InstructionFile\InstructionFileRepository:

Public Member Functions

 __construct (CollectionWrapper $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

CollectionWrapper $wrapper
 
CollectionWrapper $collection
 
ilDBInterface $db
 

Detailed Description

Definition at line 28 of file InstructionFileRepository.php.

Constructor & Destructor Documentation

◆ __construct()

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

Member Function Documentation

◆ clone()

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

Definition at line 145 of file InstructionFileRepository.php.

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

148  : void {
149  $from_rcid = $this->getIdStringForAssId($from_ass_id);
150  $to_rcid = $this->wrapper->clone($from_rcid);
151  if ($to_rcid !== "") {
152  $this->db->update(
153  "exc_assignment",
154  [
155  "if_rcid" => ["text", $to_rcid]
156  ],
157  [ // where
158  "id" => ["integer", $to_ass_id]
159  ]
160  );
161  }
162  }
+ Here is the call graph for this function:

◆ 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  }

◆ deleteCollection()

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

Definition at line 131 of file InstructionFileRepository.php.

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

134  : void {
135  $rcid = $this->getIdStringForAssId($ass_id);
136  if ($rcid === "") {
137  return;
138  }
139  $this->wrapper->deleteCollectionForIdString(
140  $rcid,
141  $stakeholder
142  );
143  }
+ Here is the call graph for this function:

◆ getCollection()

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

Definition at line 74 of file InstructionFileRepository.php.

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

Referenced by ILIAS\Exercise\InstructionFile\InstructionFileRepository\getCollectionResourcesInfo(), ILIAS\Exercise\InstructionFile\InstructionFileRepository\importFromDirectory(), and ILIAS\Exercise\InstructionFile\InstructionFileRepository\importFromLegacyUpload().

74  : ?ResourceCollection
75  {
76  $rcid = $this->getIdStringForAssId($ass_id);
77  if ($rcid !== "") {
78  return $this->wrapper->getCollectionForIdString($rcid);
79  }
80  return null;
81  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCollectionResourcesInfo()

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

Definition at line 124 of file InstructionFileRepository.php.

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

Referenced by ILIAS\Exercise\InstructionFile\InstructionFileRepository\importFromDirectory().

126  : \Generator {
127  $collection = $this->getCollection($ass_id);
128  return $this->wrapper->getCollectionResourcesInfo($collection);
129  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIdStringForAssId()

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

Definition at line 56 of file InstructionFileRepository.php.

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

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  }
+ 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.

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

68  : bool
69  {
70  $rcid = $this->getIdStringForAssId($ass_id);
71  return ($rcid !== "");
72  }
+ 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.

References ILIAS\Exercise\InstructionFile\InstructionFileRepository\getCollection(), and ILIAS\Exercise\InstructionFile\InstructionFileRepository\getCollectionResourcesInfo().

102  : void {
103  $collection = $this->getCollection($ass_id);
104  if ($collection) {
105  $this->wrapper->importFilesFromDirectoryToCollection(
106  $collection,
107  $dir,
108  $stakeholder
109  );
110  }
111  }
+ Here is the call graph for this function:

◆ importFromLegacyUpload()

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

Definition at line 83 of file InstructionFileRepository.php.

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

87  : void {
88  $collection = $this->getCollection($ass_id);
89  if ($collection) {
90  $this->wrapper->importFilesFromLegacyUploadToCollection(
92  $file_input,
93  $stakeholder
94  );
95  }
96  }
+ Here is the call graph for this function:

Field Documentation

◆ $collection

CollectionWrapper ILIAS\Exercise\InstructionFile\InstructionFileRepository::$collection
protected

Definition at line 31 of file InstructionFileRepository.php.

◆ $db

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

◆ $wrapper

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

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