ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Exercise\Assignment\AssignmentsDBRepository Class Reference
+ Collaboration diagram for ILIAS\Exercise\Assignment\AssignmentsDBRepository:

Public Member Functions

 __construct (InternalDataService $data, \ilDBInterface $db)
 
 getList (int $exc_id)
 
 get (int $exc_id, int $ass_id)
 

Protected Member Functions

 getAssignmentFromRecord (array $rec)
 

Protected Attributes

ilDBInterface $db
 
InternalDataService $data
 

Detailed Description

Definition at line 25 of file AssignmentsDBRepository.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Exercise\Assignment\AssignmentsDBRepository::__construct ( InternalDataService  $data,
\ilDBInterface  $db 
)

Member Function Documentation

◆ get()

ILIAS\Exercise\Assignment\AssignmentsDBRepository::get ( int  $exc_id,
int  $ass_id 
)

Definition at line 72 of file AssignmentsDBRepository.php.

References $ass_id, ILIAS\Exercise\Assignment\AssignmentsDBRepository\getAssignmentFromRecord(), and null.

72  : ?Assignment
73  {
74  $set = $this->db->queryF(
75  "SELECT * FROM exc_assignment " .
76  " WHERE exc_id = %s AND id = %s",
77  ["integer", "integer"],
78  [$exc_id, $ass_id]
79  );
80  if ($rec = $this->db->fetchAssoc($set)) {
81  return $this->getAssignmentFromRecord($rec);
82  }
83  return null;
84  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the call graph for this function:

◆ getAssignmentFromRecord()

ILIAS\Exercise\Assignment\AssignmentsDBRepository::getAssignmentFromRecord ( array  $rec)
protected

Definition at line 38 of file AssignmentsDBRepository.php.

Referenced by ILIAS\Exercise\Assignment\AssignmentsDBRepository\get(), and ILIAS\Exercise\Assignment\AssignmentsDBRepository\getList().

38  : Assignment
39  {
40  return $this->data->assignment(
41  (int) $rec["id"],
42  (int) $rec["exc_id"],
43  (string) $rec["title"],
44  (int) $rec["order_nr"],
45  (int) $rec["type"],
46  (string) $rec["instruction"],
47  (bool) $rec["mandatory"],
48  (int) $rec["deadline_mode"],
49  (int) $rec["time_stamp"],
50  (int) $rec["deadline2"],
51  (int) $rec["relative_deadline"],
52  (int) $rec["rel_deadline_last_subm"]
53  );
54  }
+ Here is the caller graph for this function:

◆ getList()

ILIAS\Exercise\Assignment\AssignmentsDBRepository::getList ( int  $exc_id)
Returns
iterable<Assignment>

Definition at line 59 of file AssignmentsDBRepository.php.

References ILIAS\Exercise\Assignment\AssignmentsDBRepository\getAssignmentFromRecord().

59  : \Iterator
60  {
61  $set = $this->db->query("SELECT * FROM exc_assignment " .
62  " WHERE exc_id = " . $this->db->quote($exc_id, "integer") .
63  " ORDER BY order_nr");
64  $order_val = 10;
65  while ($rec = $this->db->fetchAssoc($set)) {
66  $rec["order_nr"] = $order_val;
67  $order_val += 10;
68  yield $this->getAssignmentFromRecord($rec);
69  }
70  }
+ Here is the call graph for this function:

Field Documentation

◆ $data

InternalDataService ILIAS\Exercise\Assignment\AssignmentsDBRepository::$data
protected

◆ $db

ilDBInterface ILIAS\Exercise\Assignment\AssignmentsDBRepository::$db
protected

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