3 declare(strict_types=1);
28 protected \ilDBInterface
$db;
37 $this->db = (
$db) ?: $DIC->database();
38 $this->factory_service = (
$factory_service) ?: $DIC->skills()->internal()->factory();
46 "SELECT * FROM skl_profile " .
47 " WHERE id = " .
$ilDB->quote($profile_id,
"integer")
50 if ($rec =
$ilDB->fetchAssoc($set)) {
53 throw new \ilSkillProfileNotFoundException(
"Profile with ID $profile_id not found.");
58 $rec[
"id"] = (
int) $rec[
"id"];
59 $rec[
"title"] = (string) $rec[
"title"];
60 $rec[
"description"] = (string) $rec[
"description"];
61 $rec[
"skill_tree_id"] = (
int) $rec[
"skill_tree_id"];
62 $rec[
"image_id"] = (string) $rec[
"image_id"];
63 $rec[
"ref_id"] = (
int) $rec[
"ref_id"];
65 return $this->factory_service->profile()->profile(
69 $rec[
"skill_tree_id"],
79 $next_id =
$ilDB->nextId(
"skl_profile");
89 $ilDB->manipulate(
"INSERT INTO skl_profile " .
90 "(id, title, description, skill_tree_id, image_id, ref_id) VALUES (" .
91 $ilDB->quote($new_profile_id,
"integer") .
"," .
99 return $this->
get($new_profile_id);
109 "UPDATE skl_profile SET " .
110 " title = " .
$ilDB->quote($profile->
getTitle(),
"text") .
"," .
113 " WHERE id = " .
$ilDB->quote($profile->
getId(),
"integer") .
114 " AND ref_id = " .
$ilDB->quote($profile->
getRefId(),
"integer")
117 return $this->
get($profile->
getId());
125 "DELETE FROM skl_profile WHERE " .
126 " id = " .
$ilDB->quote($profile_id,
"integer")
135 "DELETE FROM skl_profile WHERE " .
136 " ref_id = " .
$ilDB->quote($ref_id,
"integer")
148 "SELECT * FROM skl_profile " .
152 while ($rec =
$ilDB->fetchAssoc($set)) {
167 "SELECT * FROM skl_profile " .
168 " WHERE skill_tree_id = " .
$ilDB->quote($skill_tree_id,
"integer") .
172 while ($rec =
$ilDB->fetchAssoc($set)) {
187 "SELECT * FROM skl_profile " .
188 " WHERE ref_id = 0 " .
192 while ($rec =
$ilDB->fetchAssoc($set)) {
207 "SELECT * FROM skl_profile " .
208 " WHERE ref_id = " . $ref_id .
212 while ($rec =
$ilDB->fetchAssoc($set)) {
224 "SELECT " . $field .
" FROM skl_profile " .
225 " WHERE id = " .
$ilDB->quote($id,
"integer")
227 $rec =
$ilDB->fetchAssoc($set);
229 return (
string) ($rec[$field] ??
"");
239 "ref_id" => array(
"integer", $new_ref_id)
242 "id" => array(
"integer", $profile_id)
252 "SELECT * FROM skl_profile " .
257 $rec = $db->fetchAssoc($set);
258 return (
int) ($rec[
"skill_tree_id"] ?? 0);
updateRefIdAfterImport(int $profile_id, int $new_ref_id)
getProfilesForAllSkillTrees()
deleteProfile(int $profile_id)
getLocalProfilesForObject(int $ref_id)
getTreeId(int $profile_id)
Skill internal factory service.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
queryF(string $query, array $types, array $values)
Service SkillInternalFactoryService $factory_service
getProfilesForSkillTree(int $skill_tree_id)
deleteProfilesFromObject(int $ref_id)
getFromRecord(array $rec)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
createProfile(SkillProfile $profile)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(\ilDBInterface $db=null, Service\SkillInternalFactoryService $factory_service=null)
updateProfile(SkillProfile $profile)
lookup(int $id, string $field)