29 protected \ilDBInterface
$db;
35 $this->db = (
$db) ?: $DIC->database();
41 public function getEntries(
int $user_id,
int $profile_id): array
46 "SELECT * FROM skl_profile_completion " .
47 " WHERE profile_id = " .
$ilDB->quote($profile_id,
"integer") .
48 " AND user_id = " .
$ilDB->quote($user_id,
"integer")
51 while ($rec =
$ilDB->fetchAssoc($set)) {
53 "profile_id" => $rec[
"profile_id"],
54 "user_id" => $rec[
"user_id"],
55 "date" => $rec[
"date"],
56 "fulfilled" => $rec[
"fulfilled"]
71 "SELECT * FROM skl_profile_completion " .
72 " WHERE profile_id = " .
$ilDB->quote($profile_id,
"integer") .
73 " AND user_id = " .
$ilDB->quote($user_id,
"integer") .
74 " ORDER BY date DESC" .
79 while ($rec =
$ilDB->fetchAssoc($set)) {
80 $entry = $rec[
"fulfilled"];
85 $ilDB->manipulate(
"INSERT INTO skl_profile_completion " .
86 "(profile_id, user_id, date, fulfilled) VALUES (" .
87 $ilDB->quote($profile_id,
"integer") .
"," .
88 $ilDB->quote($user_id,
"integer") .
"," .
89 $ilDB->quote($now,
"timestamp") .
"," .
90 $ilDB->quote(1,
"integer") .
103 "SELECT * FROM skl_profile_completion " .
104 " WHERE profile_id = " .
$ilDB->quote($profile_id,
"integer") .
105 " AND user_id = " .
$ilDB->quote($user_id,
"integer") .
106 " ORDER BY date DESC" .
111 while ($rec =
$ilDB->fetchAssoc($set)) {
112 $entry = $rec[
"fulfilled"];
115 if (is_null($entry) || $entry == 1) {
117 $ilDB->manipulate(
"INSERT INTO skl_profile_completion " .
118 "(profile_id, user_id, date, fulfilled) VALUES (" .
119 $ilDB->quote($profile_id,
"integer") .
"," .
120 $ilDB->quote($user_id,
"integer") .
"," .
121 $ilDB->quote($now,
"timestamp") .
"," .
122 $ilDB->quote(0,
"integer") .
135 $ilDB = $DIC->database();
138 "SELECT * FROM skl_profile_completion " .
139 " WHERE user_id = " .
$ilDB->quote($user_id,
"integer") .
143 while ($rec =
$ilDB->fetchAssoc($set)) {
145 "profile_id" => (
int) $rec[
"profile_id"],
146 "user_id" => (
int) $rec[
"user_id"],
147 "date" => $rec[
"date"],
148 "fulfilled" => (
int) $rec[
"fulfilled"]
162 $ilDB = $DIC->database();
165 "SELECT * FROM skl_profile_completion " .
166 " WHERE user_id = " .
$ilDB->quote($user_id,
"integer")
169 while ($rec =
$ilDB->fetchAssoc($set)) {
171 "profile_id" => $rec[
"profile_id"],
172 "user_id" => $rec[
"user_id"],
173 "date" => $rec[
"date"],
174 "fulfilled" => $rec[
"fulfilled"]
188 $ilDB = $DIC->database();
191 "SELECT * FROM skl_profile_completion " .
192 " WHERE profile_id = " .
$ilDB->quote($profile_id,
"integer")
195 while ($rec =
$ilDB->fetchAssoc($set)) {
197 "profile_id" => $rec[
"profile_id"],
198 "user_id" => $rec[
"user_id"],
199 "date" => $rec[
"date"],
200 "fulfilled" => $rec[
"fulfilled"]
215 "DELETE FROM skl_profile_completion WHERE " 216 .
" profile_id = " .
$ilDB->quote($profile_id,
"integer")
228 "DELETE FROM skl_profile_completion WHERE " 229 .
" user_id = " .
$ilDB->quote($user_id,
"integer")
getFulfilledEntriesForUser(int $user_id)
Get all profile completion entries for a user.
deleteEntriesForProfile(int $profile_id)
Delete all profile completion entries for a profile.
getAllEntriesForProfile(int $profile_id)
Get all completion entries for a single profile.
getAllEntriesForUser(int $user_id)
Get all profile completion entries for a user.
static now()
Return current timestamp in Y-m-d H:i:s format.
deleteEntriesForUser(int $user_id)
Delete all profile completion entries for a user.
__construct(\ilDBInterface $db=null)
getEntries(int $user_id, int $profile_id)
Get profile completion entries for given user-profile-combination.
Repository for skill profile completion.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addNonFulfilmentEntry(int $user_id, int $profile_id)
Add profile non-fulfilment entry to given user-profile-combination.
addFulfilmentEntry(int $user_id, int $profile_id)
Add profile fulfilment entry to given user-profile-combination.