ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilExcMemberRepository.php
Go to the documentation of this file.
1<?php
2
24{
25 protected ilDBInterface $db;
26
27 public function __construct(?ilDBInterface $db = null)
28 {
29 global $DIC;
30
31 $this->db = (is_null($db))
32 ? $DIC->database()
33 : $db;
34 }
35
42 public function getExerciseIdsOfUser(
43 int $user_id
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 }
60}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(?ilDBInterface $db=null)
getExerciseIdsOfUser(int $user_id)
Get all exercise IDs of a user.
Interface ilDBInterface.
fetchAssoc(ilDBStatement $statement)
queryF(string $query, array $types, array $values)
global $DIC
Definition: shib_login.php:26