41 $this->db = (is_null($db))
51 "rep_rec_content_role",
53 "role_id" => [
"integer", $role_id],
54 "ref_id" => [
"integer", $ref_id]
65 "DELETE FROM rep_rec_content_role WHERE " .
66 " role_id = %s AND ref_id = %s",
67 [
"integer",
"integer"],
77 $db->
insert(
"rep_rec_content_obj", [
78 "user_id" => [
"integer", $user_id],
79 "ref_id" => [
"integer", $ref_id],
80 "declined" => [
"integer",
false]
90 "DELETE FROM rep_rec_content_obj WHERE " .
91 " user_id = %s AND ref_id = %s",
92 [
"integer",
"integer"],
102 "DELETE FROM rep_rec_content_obj WHERE " .
109 "DELETE FROM rep_rec_content_role WHERE " .
121 "DELETE FROM rep_rec_content_obj WHERE " .
133 "DELETE FROM rep_rec_content_role WHERE " .
146 "SELECT * FROM rep_rec_content_obj " .
147 " WHERE user_id = %s AND ref_id = %s",
148 [
"integer",
"integer"],
163 "rep_rec_content_obj",
165 "declined" => [
"integer",
true]
168 "user_id" => [
"integer", $user_id],
169 "ref_id" => [
"integer", $ref_id]
173 $db->
insert(
"rep_rec_content_obj", [
174 "user_id" => [
"integer", $user_id],
175 "ref_id" => [
"integer", $ref_id],
176 "declined" => [
"integer",
true]
192 "SELECT DISTINCT ref_id FROM rep_rec_content_role " .
193 " WHERE " . $db->
in(
"role_id", $role_ids,
false,
"integer")
208 "SELECT ref_id FROM rep_rec_content_obj " .
209 " WHERE user_id = %s AND declined = %s",
210 [
"integer",
"integer"],
226 "SELECT ref_id FROM rep_rec_content_obj " .
227 " WHERE user_id = %s AND declined = %s",
228 [
"integer",
"integer"],
248 $recommendations = array_unique($role_recommendations + $obj_recommendations);
252 return array_filter($recommendations,
static function (
int $i) use ($declined_recommendations):
bool {
253 return !in_array($i, $declined_recommendations,
true);
addObjectRecommendation(int $user_id, int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
insert(string $table_name, array $values)
manipulateF(string $query, array $types, array $values)
addRoleRecommendation(int $role_id, int $ref_id)
fetchAssoc(ilDBStatement $statement)
removeRecommendationsOfRole(int $role_id)
getOpenRecommendationsOfUser(int $user_id, array $role_ids)
Open recommendations of user (by role or object, without declined ones)
update(string $table_name, array $values, array $where)
$where MUST contain existing columns only.
removeRecommendationsOfRefId(int $ref_id)
fetchAll(ilDBStatement $statement, int $fetch_mode=ilDBConstants::FETCHMODE_ASSOC)
declineObjectRecommendation(int $user_id, int $ref_id)
__construct(?ilDBInterface $db=null)
ifExistsObjectRecommendation(int $user_id, int $ref_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getRecommendationsOfRoles(array $role_ids)
Get recommendations of roles.
removeRecommendationsOfUser(int $user_id)
getDeclinedUserObjectRecommendations(int $user_id)
Get declined user object recommendations.
query(string $query)
Run a (read-only) Query on the database.
queryF(string $query, array $types, array $values)
in(string $field, array $values, bool $negate=false, string $type="")
removeRoleRecommendation(int $role_id, int $ref_id)
replace(string $table, array $primary_keys, array $other_columns)
Replace into method.
getUserObjectRecommendations(int $user_id)
Get user object recommendations.
removeObjectRecommendation(int $user_id, int $ref_id)