ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilExcMemberRepository Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilExcMemberRepository:

Public Member Functions

 __construct (?ilDBInterface $db=null)
 
 getExerciseIdsOfUser (int $user_id)
 Get all exercise IDs of a user. More...
 

Protected Attributes

ilDBInterface $db
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning This should hold all accesses to exc_members table in the future

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 23 of file class.ilExcMemberRepository.php.

Constructor & Destructor Documentation

◆ __construct()

ilExcMemberRepository::__construct ( ?ilDBInterface  $db = null)

Definition at line 27 of file class.ilExcMemberRepository.php.

References $db, and $DIC.

28  {
29  global $DIC;
30 
31  $this->db = (is_null($db))
32  ? $DIC->database()
33  : $db;
34  }
global $DIC
Definition: shib_login.php:22

Member Function Documentation

◆ getExerciseIdsOfUser()

ilExcMemberRepository::getExerciseIdsOfUser ( int  $user_id)

Get all exercise IDs of a user.

Parameters
intuser id
Returns
int[] exercise ids

Definition at line 42 of file class.ilExcMemberRepository.php.

References $db, ilDBInterface\fetchAssoc(), and ilDBInterface\queryF().

44  : array {
45  $db = $this->db;
46 
47  $set = $db->queryF(
48  "SELECT DISTINCT obj_id FROM exc_members " .
49  " WHERE usr_id = %s ",
50  array("integer"),
51  array($user_id)
52  );
53  $ids = [];
54  while ($rec = $db->fetchAssoc($set)) {
55  $ids[] = $rec["obj_id"];
56  }
57 
58  return $ids;
59  }
fetchAssoc(ilDBStatement $statement)
queryF(string $query, array $types, array $values)
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilExcMemberRepository::$db
protected

Definition at line 25 of file class.ilExcMemberRepository.php.

Referenced by __construct(), and getExerciseIdsOfUser().


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