ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.MemberDBRepo.php
Go to the documentation of this file.
1<?php
2
20
25{
26 protected \ilDBInterface $db;
27
28 public function __construct(\ilDBInterface $db)
29 {
30 $this->db = $db;
31 }
32
33 public function filterObjIdsByTutorialSupport(array $obj_ids, string $lastname): array
34 {
35 $db = $this->db;
36 $set = $db->queryF(
37 "SELECT DISTINCT(obj_id) FROM obj_members m JOIN usr_data u ON (u.usr_id = m.usr_id) " .
38 " WHERE " . $db->in("m.obj_id", $obj_ids, false, "integer") .
39 " AND " . $db->like("u.lastname", "text", $lastname) .
40 " AND m.contact = %s",
41 array("integer"),
42 array(1)
43 );
44 $result_obj_ids = [];
45 while ($rec = $db->fetchAssoc($set)) {
46 $result_obj_ids[] = $rec["obj_id"];
47 }
48 return array_intersect($obj_ids, $result_obj_ids);
49 }
50}
filterObjIdsByTutorialSupport(array $obj_ids, string $lastname)
Interface ilDBInterface.
like(string $column, string $type, string $value="?", bool $case_insensitive=true)
Generate a like subquery.
fetchAssoc(ilDBStatement $statement)
queryF(string $query, array $types, array $values)
in(string $field, array $values, bool $negate=false, string $type="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...