ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
class.MemberDBRepo.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2022 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
6 
11 {
12  protected \ilDBInterface $db;
13 
14  public function __construct(\ilDBInterface $db)
15  {
16  $this->db = $db;
17  }
18 
19  public function filterObjIdsByTutorialSupport(array $obj_ids, string $lastname): array
20  {
21  $db = $this->db;
22  $set = $db->queryF(
23  "SELECT DISTINCT(obj_id) FROM obj_members m JOIN usr_data u ON (u.usr_id = m.usr_id) " .
24  " WHERE " . $db->in("m.obj_id", $obj_ids, false, "integer") .
25  " AND " . $db->like("u.lastname", "text", $lastname) .
26  " AND m.contact = %s",
27  array("integer"),
28  array(1)
29  );
30  $result_obj_ids = [];
31  while ($rec = $db->fetchAssoc($set)) {
32  $result_obj_ids[] = $rec["obj_id"];
33  }
34  return array_intersect($obj_ids, $result_obj_ids);
35  }
36 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
filterObjIdsByTutorialSupport(array $obj_ids, string $lastname)
queryF(string $query, array $types, array $values)