26 protected \ilDBInterface
$db;
33 $this->db = (
$db) ?: $DIC->database();
34 $this->factory_service = (
$factory_service) ?: $DIC->skills()->internal()->factory();
42 "SELECT * FROM skl_profile " .
43 " WHERE id = " .
$ilDB->quote($profile_id,
"integer")
46 if ($rec =
$ilDB->fetchAssoc($set)) {
49 throw new \ilSkillProfileNotFoundException(
"Profile with ID $profile_id not found.");
54 $rec[
"id"] = (
int) $rec[
"id"];
55 $rec[
"title"] = (string) $rec[
"title"];
56 $rec[
"description"] = (string) $rec[
"description"];
57 $rec[
"skill_tree_id"] = (
int) $rec[
"skill_tree_id"];
58 $rec[
"image_id"] = (string) $rec[
"image_id"];
59 $rec[
"ref_id"] = (
int) $rec[
"ref_id"];
61 return $this->factory_service->profile(
65 $rec[
"skill_tree_id"],
75 $next_id =
$ilDB->nextId(
"skl_profile");
85 $ilDB->manipulate(
"INSERT INTO skl_profile " .
86 "(id, title, description, skill_tree_id, image_id, ref_id) VALUES (" .
87 $ilDB->quote($new_profile_id,
"integer") .
"," .
95 return $this->
getById($new_profile_id);
105 "UPDATE skl_profile SET " .
106 " title = " .
$ilDB->quote($profile->
getTitle(),
"text") .
"," .
109 " WHERE id = " .
$ilDB->quote($profile->
getId(),
"integer") .
110 " AND ref_id = " .
$ilDB->quote($profile->
getRefId(),
"integer")
121 "DELETE FROM skl_profile WHERE " .
122 " id = " .
$ilDB->quote($profile_id,
"integer")
131 "DELETE FROM skl_profile WHERE " .
132 " ref_id = " .
$ilDB->quote($ref_id,
"integer")
141 "SELECT * FROM skl_profile " .
145 while ($rec =
$ilDB->fetchAssoc($set)) {
146 $profiles[$rec[
"id"]] = $rec;
157 "SELECT * FROM skl_profile " .
158 " WHERE skill_tree_id = " .
$ilDB->quote($skill_tree_id,
"integer") .
162 while ($rec =
$ilDB->fetchAssoc($set)) {
163 $profiles[$rec[
"id"]] = $rec;
174 "SELECT * FROM skl_profile " .
175 " WHERE ref_id = 0 " .
179 while ($rec =
$ilDB->fetchAssoc($set)) {
180 $profiles[$rec[
"id"]] = $rec;
191 "SELECT * FROM skl_profile " .
192 " WHERE ref_id = " . $ref_id .
196 while ($rec =
$ilDB->fetchAssoc($set)) {
197 $profiles[$rec[
"id"]] = $rec;
208 "SELECT " . $field .
" FROM skl_profile " .
209 " WHERE id = " .
$ilDB->quote($id,
"integer")
211 $rec =
$ilDB->fetchAssoc($set);
213 return (
string) ($rec[$field] ??
"");
223 "ref_id" => array(
"integer", $new_ref_id)
226 "id" => array(
"integer", $profile_id)
236 "SELECT * FROM skl_profile " .
241 $rec = $db->fetchAssoc($set);
242 return (
int) ($rec[
"skill_tree_id"] ?? 0);
updateRefIdAfterImport(int $profile_id, int $new_ref_id)
getProfileFromRecord(array $rec)
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)
$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)