ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilSkillTemplateReference Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilSkillTemplateReference:
+ Collaboration diagram for ilSkillTemplateReference:

Public Member Functions

 __construct (int $a_id=0)
 
 setSkillTemplateId (int $a_val)
 
 getSkillTemplateId ()
 
 read ()
 
 create ()
 
 update ()
 
 delete ()
 
 copy ()
 
- Public Member Functions inherited from ilSkillTreeNode
 __construct (int $a_id=0)
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setDescription (string $a_description)
 
 getDescription ()
 
 setType (string $a_type)
 
 getType ()
 
 setId (int $a_id)
 
 getId ()
 
 setSelfEvaluation (bool $a_val)
 
 getSelfEvaluation ()
 
 setOrderNr (int $a_val)
 
 getOrderNr ()
 
 setImportId (string $a_val)
 
 getImportId ()
 
 getCreationDate ()
 
 read ()
 Read Data of Node. More...
 
 setDataRecord (array $a_record)
 this method should only be called by class ilSCORM2004NodeFactory More...
 
 setStatus (int $a_val)
 
 getStatus ()
 
 create ()
 Create Node. More...
 
 update ()
 Update Node. More...
 
 delete ()
 

Static Public Member Functions

static _lookupTemplateId (int $a_obj_id)
 
static _lookupTrefIdsForTopTemplateId (int $a_template_id)
 
static _lookupTrefIdsForTemplateId (int $a_tid)
 
- Static Public Member Functions inherited from ilSkillTreeNode
static getAllStatus ()
 Get all status as array, key is value, value is lang text. More...
 
static getStatusInfo (int $a_status)
 
static _lookupTitle (int $a_obj_id, int $a_tref_id=0)
 
static _lookupDescription (int $a_obj_id)
 
static _lookupSelfEvaluation (int $a_obj_id)
 
static _lookupStatus (int $a_obj_id)
 
static _lookupType (int $a_obj_id)
 
static _writeTitle (int $a_obj_id, string $a_title)
 
static _writeDescription (int $a_obj_id, string $a_description)
 
static _writeOrderNr (int $a_obj_id, int $a_nr)
 
static uniqueTypesCheck (array $a_items)
 Check for unique types. More...
 
static getAllSelfEvaluationNodes ()
 
static getSelectableSkills ()
 
static getIconPath (int $a_obj_id, string $a_type, string $a_size="", int $a_status=0)
 
static getAllCSkillIdsForNodeIds (array $a_node_ids)
 Get all possible common skill IDs for node IDs. More...
 

Protected Attributes

ilDBInterface $db
 
int $skill_template_id = 0
 
- Protected Attributes inherited from ilSkillTreeNode
ilDBInterface $db
 
ILIAS Skill Service SkillService $skill_service
 
string $type = ""
 
int $id = 0
 
string $title = ""
 
string $description = ""
 
bool $self_eval = false
 
int $order_nr = 0
 
string $import_id = ""
 
string $creation_date = ""
 
int $status = 0
 
array $data_record = []
 

Additional Inherited Members

- Data Fields inherited from ilSkillTreeNode
const STATUS_PUBLISH = 0
 
const STATUS_DRAFT = 1
 
const STATUS_OUTDATED = 2
 
- Protected Member Functions inherited from ilSkillTreeNode
 setCreationDate (string $a_val)
 
- Static Protected Member Functions inherited from ilSkillTreeNode
static _lookup (int $a_obj_id, string $a_field)
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Skill Template Reference

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e

Definition at line 27 of file class.ilSkillTemplateReference.php.

Constructor & Destructor Documentation

◆ __construct()

ilSkillTemplateReference::__construct ( int  $a_id = 0)

Definition at line 32 of file class.ilSkillTemplateReference.php.

References $DIC, ILIAS\MetaData\Repository\Validation\Data\__construct(), and ilSkillTreeNode\setType().

33  {
34  global $DIC;
35 
36  $this->db = $DIC->database();
37  parent::__construct($a_id);
38  $this->setType("sktr");
39  }
setType(string $a_type)
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ _lookupTemplateId()

static ilSkillTemplateReference::_lookupTemplateId ( int  $a_obj_id)
static

Definition at line 118 of file class.ilSkillTemplateReference.php.

References $DIC, and $ilDB.

Referenced by ilSkillTreeNode\_lookupTitle(), ilPersonalSkillsGUI\assignMaterials(), ilCOPageHTMLExport\collectPageElements(), ilObjSkillTreeGUI\deleteNodes(), ilSkillCatTableGUI\fillRow(), ilSkillTreeNode\getAllCSkillIdsForNodeIds(), ilVirtualSkillTree\getChildsOfNode(), ilSkillTreeDBRepository\getCommonSkillIdForImportId(), ilSkillTreeNode\getIconPath(), ilVirtualSkillTree\getNode(), ilSkillTreeExplorerGUI\getNodeContent(), ilSkillTemplateTreeExplorerGUI\getNodeContent(), ilSkillTree\getSkillTreePath(), ILIAS\Skill\Personal\AssignedMaterialManager\getUsageInfo(), ilPersonalSkillsGUI\renderSkillHTML(), ilPersonalSkillsGUI\selfEvaluation(), and ilSkillTemplateReferenceGUI\setTabs().

118  : int
119  {
120  global $DIC;
121 
122  $ilDB = $DIC->database();
123 
124  $query = "SELECT templ_id FROM skl_templ_ref WHERE skl_node_id = " .
125  $ilDB->quote($a_obj_id, "integer");
126  $obj_set = $ilDB->query($query);
127  $obj_rec = $ilDB->fetchAssoc($obj_set);
128 
129  return (int) $obj_rec["templ_id"];
130  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _lookupTrefIdsForTemplateId()

static ilSkillTemplateReference::_lookupTrefIdsForTemplateId ( int  $a_tid)
static
Parameters
int$a_tidtemplate node id (node id in template tree)
Returns
array|int[]

Definition at line 158 of file class.ilSkillTemplateReference.php.

References $DIC.

Referenced by ilObjSkillTreeGUI\deleteNodes(), ilSkillTreeNode\getAllCSkillIdsForNodeIds(), and ILIAS\Skill\Usage\SkillUsageManager\getAllUsagesOfTemplate().

158  : array
159  {
160  global $DIC;
161 
162  $tree = $DIC->skills()->internal()->repo()->getTreeRepo()->getTreeForNodeId($a_tid);
163  $top_template_id = $tree->getTopParentNodeId($a_tid);
164  return self::_lookupTrefIdsForTopTemplateId($top_template_id);
165  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ _lookupTrefIdsForTopTemplateId()

static ilSkillTemplateReference::_lookupTrefIdsForTopTemplateId ( int  $a_template_id)
static
Parameters
int$a_template_id(top) template node id
Returns
array|int[]

Definition at line 136 of file class.ilSkillTemplateReference.php.

References $DIC, $ilDB, and ILIAS\Repository\int().

Referenced by ilObjSkillTreeGUI\deleteNodes(), ILIAS\Skill\Node\SkillDeletionManager\deleteSkillCategoryTemplate(), and ILIAS\Skill\Node\SkillDeletionManager\deleteSkillTemplate().

136  : array
137  {
138  global $DIC;
139 
140  $ilDB = $DIC->database();
141 
142  $set = $ilDB->query(
143  "SELECT * FROM skl_templ_ref " .
144  " WHERE templ_id = " . $ilDB->quote($a_template_id, "integer")
145  );
146  $trefs = [];
147  while ($rec = $ilDB->fetchAssoc($set)) {
148  $trefs[] = (int) $rec["skl_node_id"];
149  }
150  return $trefs;
151  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copy()

ilSkillTemplateReference::copy ( )

Definition at line 104 of file class.ilSkillTemplateReference.php.

References ilSkillTreeNode\getDescription(), ilSkillTreeNode\getOrderNr(), ilSkillTreeNode\getSelfEvaluation(), getSkillTemplateId(), ilSkillTreeNode\getTitle(), and ilSkillTreeNode\getType().

105  {
106  $sktr = new ilSkillTemplateReference();
107  $sktr->setTitle($this->getTitle());
108  $sktr->setDescription($this->getDescription());
109  $sktr->setType($this->getType());
110  $sktr->setSkillTemplateId($this->getSkillTemplateId());
111  $sktr->setSelfEvaluation($this->getSelfEvaluation());
112  $sktr->setOrderNr($this->getOrderNr());
113  $sktr->create();
114 
115  return $sktr;
116  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ create()

ilSkillTemplateReference::create ( )

Definition at line 66 of file class.ilSkillTemplateReference.php.

References $db, and $ilDB.

66  : void
67  {
68  $ilDB = $this->db;
69 
70  parent::create();
71 
72  $ilDB->manipulate("INSERT INTO skl_templ_ref " .
73  "(skl_node_id, templ_id) VALUES (" .
74  $ilDB->quote($this->getId(), "integer") . "," .
75  $ilDB->quote($this->getSkillTemplateId(), "integer") .
76  ")");
77  }

◆ delete()

ilSkillTemplateReference::delete ( )

Definition at line 92 of file class.ilSkillTemplateReference.php.

References $db, and $ilDB.

92  : void
93  {
94  $ilDB = $this->db;
95 
96  $ilDB->manipulate(
97  "DELETE FROM skl_templ_ref WHERE "
98  . " skl_node_id = " . $ilDB->quote($this->getId(), "integer")
99  );
100 
101  parent::delete();
102  }

◆ getSkillTemplateId()

ilSkillTemplateReference::getSkillTemplateId ( )

Definition at line 46 of file class.ilSkillTemplateReference.php.

References $skill_template_id.

Referenced by copy().

46  : int
47  {
49  }
+ Here is the caller graph for this function:

◆ read()

ilSkillTemplateReference::read ( )

Definition at line 51 of file class.ilSkillTemplateReference.php.

References $db, $ilDB, and setSkillTemplateId().

51  : void
52  {
53  $ilDB = $this->db;
54 
55  parent::read();
56 
57  $set = $ilDB->query(
58  "SELECT * FROM skl_templ_ref " .
59  " WHERE skl_node_id = " . $ilDB->quote($this->getId(), "integer")
60  );
61  if ($rec = $ilDB->fetchAssoc($set)) {
62  $this->setSkillTemplateId((int) $rec["templ_id"]);
63  }
64  }
+ Here is the call graph for this function:

◆ setSkillTemplateId()

ilSkillTemplateReference::setSkillTemplateId ( int  $a_val)

Definition at line 41 of file class.ilSkillTemplateReference.php.

Referenced by read().

41  : void
42  {
43  $this->skill_template_id = $a_val;
44  }
+ Here is the caller graph for this function:

◆ update()

ilSkillTemplateReference::update ( )

Definition at line 79 of file class.ilSkillTemplateReference.php.

References $db, and $ilDB.

79  : void
80  {
81  $ilDB = $this->db;
82 
83  parent::update();
84 
85  $ilDB->manipulate(
86  "UPDATE skl_templ_ref SET " .
87  " templ_id = " . $ilDB->quote($this->getSkillTemplateId(), "integer") .
88  " WHERE skl_node_id = " . $ilDB->quote($this->getId(), "integer")
89  );
90  }

Field Documentation

◆ $db

ilDBInterface ilSkillTemplateReference::$db
protected

Definition at line 29 of file class.ilSkillTemplateReference.php.

Referenced by create(), delete(), read(), and update().

◆ $skill_template_id

int ilSkillTemplateReference::$skill_template_id = 0
protected

Definition at line 30 of file class.ilSkillTemplateReference.php.

Referenced by getSkillTemplateId().


The documentation for this class was generated from the following file: