19declare(strict_types=1);
32 protected \ilDBInterface
$db;
41 $this->db = (
$db) ?:
$DIC->database();
54 "SELECT * FROM skl_profile_completion " .
55 " WHERE profile_id = " .
$ilDB->quote($profile_id,
"integer") .
59 while ($rec =
$ilDB->fetchAssoc($set)) {
68 $rec[
"profile_id"] = (
int) $rec[
"profile_id"];
69 $rec[
"user_id"] = (
int) $rec[
"user_id"];
70 $rec[
"fulfilled"] = (bool) $rec[
"fulfilled"];
72 return $this->factory_service->profile()->profileCompletion(
88 "SELECT * FROM skl_profile_completion " .
89 " WHERE profile_id = " .
$ilDB->quote($profile_id,
"integer") .
91 " ORDER BY date DESC" .
96 while ($rec =
$ilDB->fetchAssoc($set)) {
97 $entry = $rec[
"fulfilled"];
102 $ilDB->manipulate(
"INSERT INTO skl_profile_completion " .
103 "(profile_id, user_id, date, fulfilled) VALUES (" .
104 $ilDB->quote($profile_id,
"integer") .
"," .
106 $ilDB->quote($now,
"timestamp") .
"," .
107 $ilDB->quote(1,
"integer") .
120 "SELECT * FROM skl_profile_completion " .
121 " WHERE profile_id = " .
$ilDB->quote($profile_id,
"integer") .
123 " ORDER BY date DESC" .
128 while ($rec =
$ilDB->fetchAssoc($set)) {
129 $entry = $rec[
"fulfilled"];
132 if (is_null($entry) || $entry == 1) {
134 $ilDB->manipulate(
"INSERT INTO skl_profile_completion " .
135 "(profile_id, user_id, date, fulfilled) VALUES (" .
136 $ilDB->quote($profile_id,
"integer") .
"," .
138 $ilDB->quote($now,
"timestamp") .
"," .
139 $ilDB->quote(0,
"integer") .
153 "SELECT * FROM skl_profile_completion " .
158 while ($rec =
$ilDB->fetchAssoc($set)) {
174 "SELECT * FROM skl_profile_completion " .
178 while ($rec =
$ilDB->fetchAssoc($set)) {
194 "SELECT * FROM skl_profile_completion " .
195 " WHERE profile_id = " .
$ilDB->quote($profile_id,
"integer")
198 while ($rec =
$ilDB->fetchAssoc($set)) {
213 "DELETE FROM skl_profile_completion WHERE "
214 .
" profile_id = " .
$ilDB->quote($profile_id,
"integer")
226 "DELETE FROM skl_profile_completion WHERE "
Repository for skill profile completion.
getAllEntriesForProfile(int $profile_id)
Get all completion entries for a single profile.
getEntries(int $user_id, int $profile_id)
Get profile completion entries for given user-profile-combination.
deleteEntriesForUser(int $user_id)
Delete all profile completion entries for a user.
deleteEntriesForProfile(int $profile_id)
Delete all profile completion entries for a profile.
getFulfilledEntriesForUser(int $user_id)
Get all fulfilled profile completion entries for a user.
getAllEntriesForUser(int $user_id)
Get all profile completion entries for a user.
__construct(?\ilDBInterface $db=null, ?Service\SkillInternalFactoryService $factory_service=null)
Service SkillInternalFactoryService $factory_service
addFulfilmentEntry(int $user_id, int $profile_id)
Add profile fulfilment entry to given user-profile-combination.
getFromRecord(array $rec)
addNonFulfilmentEntry(int $user_id, int $profile_id)
Add profile non-fulfilment entry to given user-profile-combination.
Skill internal factory service.
static now()
Return current timestamp in Y-m-d H:i:s format.