ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilExcMemberRepository Class Reference

This should hold all accesses to exc_members table in the future. More...

+ Collaboration diagram for ilExcMemberRepository:

Public Member Functions

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

Protected Attributes

 $db
 

Detailed Description

This should hold all accesses to exc_members table in the future.

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

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

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

Parameters
ilDBInterface$db

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

25 {
26 global $DIC;
27
28 $this->db = (is_null($db))
29 ? $DIC->database()
30 : $db;
31 }
$DIC
Definition: xapitoken.php:46

References $db, and $DIC.

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 39 of file class.ilExcMemberRepository.php.

39 : array
40 {
41 $db = $this->db;
42
43 $set = $db->queryF(
44 "SELECT DISTINCT obj_id FROM exc_members " .
45 " WHERE usr_id = %s ",
46 array("integer"),
47 array($user_id)
48 );
49 $ids = [];
50 while ($rec = $db->fetchAssoc($set)) {
51 $ids[] = $rec["obj_id"];
52 }
53
54 return $ids;
55 }

References $db.

Field Documentation

◆ $db

ilExcMemberRepository::$db
protected

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

Referenced by __construct(), and getExerciseIdsOfUser().


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