ILIAS  trunk Revision v11.0_alpha-1861-g09f3d197f78
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 ()
 
 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

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)

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

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

32  {
33  global $DIC;
34 
35  $this->db = $DIC->database();
36  parent::__construct($a_id);
37  $this->setType("sktr");
38  }
setType(string $a_type)
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _lookupTemplateId()

static ilSkillTemplateReference::_lookupTemplateId ( int  $a_obj_id)
static

◆ _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.

References $DIC.

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

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  }
global $DIC
Definition: shib_login.php:22
+ 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.

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

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

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  }
global $DIC
Definition: shib_login.php:22
+ 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.

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

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  }
+ Here is the call graph for this function:

◆ create()

ilSkillTemplateReference::create ( )

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

References $db, and $ilDB.

65  : void
66  {
67  $ilDB = $this->db;
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  }

◆ delete()

ilSkillTemplateReference::delete ( )

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

References $db, and $ilDB.

91  : void
92  {
93  $ilDB = $this->db;
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  }

◆ getSkillTemplateId()

ilSkillTemplateReference::getSkillTemplateId ( )

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

References $skill_template_id.

Referenced by copy().

45  : int
46  {
48  }
+ Here is the caller graph for this function:

◆ read()

ilSkillTemplateReference::read ( )

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

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

50  : void
51  {
52  $ilDB = $this->db;
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  }
+ Here is the call graph for this function:

◆ setSkillTemplateId()

ilSkillTemplateReference::setSkillTemplateId ( int  $a_val)

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

Referenced by read().

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

◆ update()

ilSkillTemplateReference::update ( )

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

References $db, and $ilDB.

78  : void
79  {
80  $ilDB = $this->db;
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  }

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: