ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilSkillTemplateReference Class Reference

Skill Template Reference. More...

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

Public Member Functions

 __construct (int $a_id=0)
 
 setSkillTemplateId (int $a_val)
 
 getSkillTemplateId ()
 
 read ()
 Read Data of Node. More...
 
 create ()
 Create Node. More...
 
 update ()
 Update Node. More...
 
 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

Skill Template Reference.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilSkillTemplateReference::__construct ( int  $a_id = 0)

Reimplemented from ilSkillTreeNode.

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

32 {
33 global $DIC;
34
35 $this->db = $DIC->database();
37 $this->setType("sktr");
38 }
setType(string $a_type)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and ilSkillTreeNode\setType().

+ Here is the call graph for this function:

Member Function Documentation

◆ _lookupTemplateId()

static ilSkillTemplateReference::_lookupTemplateId ( int  $a_obj_id)
static

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

117 : int
118 {
119 global $DIC;
120
121 $ilDB = $DIC->database();
122
123 $query = "SELECT templ_id FROM skl_templ_ref WHERE skl_node_id = " .
124 $ilDB->quote($a_obj_id, "integer");
125 $obj_set = $ilDB->query($query);
126 $obj_rec = $ilDB->fetchAssoc($obj_set);
127
128 return (int) $obj_rec["templ_id"];
129 }

References $DIC, and $ilDB.

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

+ 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 157 of file class.ilSkillTemplateReference.php.

157 : array
158 {
159 global $DIC;
160
161 $tree = $DIC->skills()->internal()->repo()->getTreeRepo()->getTreeForNodeId($a_tid);
162 $top_template_id = $tree->getTopParentNodeId($a_tid);
163 return self::_lookupTrefIdsForTopTemplateId($top_template_id);
164 }
static _lookupTrefIdsForTopTemplateId(int $a_template_id)

References $DIC, and _lookupTrefIdsForTopTemplateId().

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

+ Here is the call graph for this function:
+ 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 135 of file class.ilSkillTemplateReference.php.

135 : array
136 {
137 global $DIC;
138
139 $ilDB = $DIC->database();
140
141 $set = $ilDB->query(
142 "SELECT * FROM skl_templ_ref " .
143 " WHERE templ_id = " . $ilDB->quote($a_template_id, "integer")
144 );
145 $trefs = [];
146 while ($rec = $ilDB->fetchAssoc($set)) {
147 $trefs[] = (int) $rec["skl_node_id"];
148 }
149 return $trefs;
150 }

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copy()

ilSkillTemplateReference::copy ( )

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

104 {
105 $sktr = new ilSkillTemplateReference();
106 $sktr->setTitle($this->getTitle());
107 $sktr->setDescription($this->getDescription());
108 $sktr->setType($this->getType());
109 $sktr->setSkillTemplateId($this->getSkillTemplateId());
110 $sktr->setSelfEvaluation($this->getSelfEvaluation());
111 $sktr->setOrderNr($this->getOrderNr());
112 $sktr->create();
113
114 return $sktr;
115 }

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

+ Here is the call graph for this function:

◆ create()

ilSkillTemplateReference::create ( )

Create Node.

Reimplemented from ilSkillTreeNode.

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

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

References $db, and $ilDB.

◆ delete()

ilSkillTemplateReference::delete ( )

Reimplemented from ilSkillTreeNode.

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

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

References $db, and $ilDB.

◆ getSkillTemplateId()

ilSkillTemplateReference::getSkillTemplateId ( )

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

References $skill_template_id.

Referenced by copy().

+ Here is the caller graph for this function:

◆ read()

ilSkillTemplateReference::read ( )

Read Data of Node.

Reimplemented from ilSkillTreeNode.

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

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

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

+ Here is the call graph for this function:

◆ setSkillTemplateId()

ilSkillTemplateReference::setSkillTemplateId ( int  $a_val)

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

40 : void
41 {
42 $this->skill_template_id = $a_val;
43 }

Referenced by read().

+ Here is the caller graph for this function:

◆ update()

ilSkillTemplateReference::update ( )

Update Node.

Reimplemented from ilSkillTreeNode.

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

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

References $db, and $ilDB.

Field Documentation

◆ $db

ilDBInterface ilSkillTemplateReference::$db
protected

Definition at line 28 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 29 of file class.ilSkillTemplateReference.php.

Referenced by getSkillTemplateId().


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