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

Public Member Functions

 __construct (CollectionWrapper $wrapper, \ilDBInterface $db)
 
 getIdStringForAssId (int $ass_id)
 
 hasFile (int $ass_id)
 
 deliverFile (int $ass_id)
 
 importFromLegacyUpload (int $ass_id, array $file_input, ResourceStakeholder $stakeholder)
 
 clone (int $from_ass_id, int $to_ass_id)
 

Protected Attributes

CollectionWrapper $wrapper
 
CollectionWrapper $collection
 
ilDBInterface $db
 

Detailed Description

Definition at line 27 of file SampleSolutionRepository.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Exercise\SampleSolution\SampleSolutionRepository::__construct ( CollectionWrapper  $wrapper,
\ilDBInterface  $db 
)

Member Function Documentation

◆ clone()

ILIAS\Exercise\SampleSolution\SampleSolutionRepository::clone ( int  $from_ass_id,
int  $to_ass_id 
)

Definition at line 89 of file SampleSolutionRepository.php.

References ILIAS\Exercise\SampleSolution\SampleSolutionRepository\getIdStringForAssId().

92  : void {
93  $from_rid = $this->getIdStringForAssId($from_ass_id);
94  $to_rid = $this->wrapper->cloneResource($from_rid);
95  if ($to_rid !== "") {
96  $this->db->update(
97  "exc_assignment",
98  [
99  "solution_rid" => ["text", $to_rid]
100  ],
101  [ // where
102  "id" => ["integer", $to_ass_id]
103  ]
104  );
105  }
106  }
+ Here is the call graph for this function:

◆ deliverFile()

ILIAS\Exercise\SampleSolution\SampleSolutionRepository::deliverFile ( int  $ass_id)

Definition at line 59 of file SampleSolutionRepository.php.

References ILIAS\Exercise\SampleSolution\SampleSolutionRepository\getIdStringForAssId().

59  : void
60  {
61  $rid = $this->getIdStringForAssId($ass_id);
62  $this->wrapper->deliverFile($rid);
63  }
+ Here is the call graph for this function:

◆ getIdStringForAssId()

ILIAS\Exercise\SampleSolution\SampleSolutionRepository::getIdStringForAssId ( int  $ass_id)

Definition at line 41 of file SampleSolutionRepository.php.

Referenced by ILIAS\Exercise\SampleSolution\SampleSolutionRepository\clone(), ILIAS\Exercise\SampleSolution\SampleSolutionRepository\deliverFile(), and ILIAS\Exercise\SampleSolution\SampleSolutionRepository\hasFile().

41  : string
42  {
43  $set = $this->db->queryF(
44  "SELECT solution_rid FROM exc_assignment " .
45  " WHERE id = %s ",
46  ["integer"],
47  [$ass_id]
48  );
49  $rec = $this->db->fetchAssoc($set);
50  return ($rec["solution_rid"] ?? "");
51  }
+ Here is the caller graph for this function:

◆ hasFile()

ILIAS\Exercise\SampleSolution\SampleSolutionRepository::hasFile ( int  $ass_id)

Definition at line 53 of file SampleSolutionRepository.php.

References ILIAS\Exercise\SampleSolution\SampleSolutionRepository\getIdStringForAssId().

53  : bool
54  {
55  $rid = $this->getIdStringForAssId($ass_id);
56  return ($rid !== "");
57  }
+ Here is the call graph for this function:

◆ importFromLegacyUpload()

ILIAS\Exercise\SampleSolution\SampleSolutionRepository::importFromLegacyUpload ( int  $ass_id,
array  $file_input,
ResourceStakeholder  $stakeholder 
)

Definition at line 65 of file SampleSolutionRepository.php.

69  : string {
70  $rcid = $this->wrapper->importFileFromLegacyUpload(
71  $file_input,
72  $stakeholder
73  );
74  if ($rcid !== "") {
75  $this->db->update(
76  "exc_assignment",
77  [
78  "fb_file" => ["text", $file_input["name"]],
79  "solution_rid" => ["text", $rcid]
80  ],
81  [ // where
82  "id" => ["integer", $ass_id]
83  ]
84  );
85  }
86  return $rcid;
87  }

Field Documentation

◆ $collection

CollectionWrapper ILIAS\Exercise\SampleSolution\SampleSolutionRepository::$collection
protected

Definition at line 30 of file SampleSolutionRepository.php.

◆ $db

ilDBInterface ILIAS\Exercise\SampleSolution\SampleSolutionRepository::$db
protected

◆ $wrapper

CollectionWrapper ILIAS\Exercise\SampleSolution\SampleSolutionRepository::$wrapper
protected

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