ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilBasicSkill Class Reference

Basic Skill. More...

+ Inheritance diagram for ilBasicSkill:
+ Collaboration diagram for ilBasicSkill:

Public Member Functions

 __construct (int $a_id=0, ?ilSkillLevelRepository $bsc_skl_lvl_db_rep=null, ?ilSkillUserLevelRepository $bsc_skl_usr_lvl_db_rep=null, ?ilSkillTreeRepository $bsc_skl_tre_rep=null)
 
 read ()
 Read data from database. More...
 
 create ()
 Create skill. More...
 
 copy ()
 Copy basic skill. More...
 
 addLevel (string $a_title, string $a_description, string $a_import_id="")
 
 getLevelData (int $a_id=0)
 
 updateLevelOrder (array $order)
 
 deleteLevel (int $a_id)
 
 fixLevelNumbering ()
 
 getSkillForLevelId (int $a_level_id)
 
 getMaxLevelPerType (int $a_tref_id, string $a_type, int $a_user_id=0, int $a_self_eval=0)
 
 getNextLevelFulfilmentPerType (int $a_tref_id, string $a_type, int $a_user_id=0, int $a_self_eval=0)
 
 getAllLevelEntriesOfUser (int $a_tref_id, int $a_user_id=0, int $a_self_eval=0)
 
 getAllHistoricLevelEntriesOfUser (int $a_tref_id, int $a_user_id=0, int $a_eval_by=0)
 
 getMaxLevelPerObject (int $a_tref_id, int $a_object_id, int $a_user_id=0, int $a_self_eval=0, string $trigger_user="")
 
 getLastLevelEntryOfUser (int $a_tref_id, int $a_user_id, int $a_object_id=0, int $a_self_eval=0, string $trigger_user="")
 
 getNextLevelFulfilmentPerObject (int $a_tref_id, int $a_object_id, int $a_user_id=0, int $a_self_eval=0)
 
 getMaxLevel (int $a_tref_id, int $a_user_id=0, int $a_self_eval=0)
 
 getNextLevelFulfilment (int $a_tref_id, int $a_user_id=0, int $a_self_eval=0)
 
 getLastLevelPerObject (int $a_tref_id, int $a_object_id, int $a_user_id=0, int $a_self_eval=0)
 
 getLastUpdatePerObject (int $a_tref_id, int $a_object_id, int $a_user_id=0, int $a_self_eval=0)
 
 getTitleForCertificate ()
 
 getShortTitleForCertificate ()
 
- 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 lookupLevelTitle (int $a_id)
 
static lookupLevelDescription (int $a_id)
 
static lookupLevelSkillId (int $a_id)
 
static writeLevelTitle (int $a_id, string $a_title)
 
static writeLevelDescription (int $a_id, string $a_description)
 
static resetUserSkillLevelStatus (int $a_user_id, int $a_skill_id, int $a_tref_id=0, int $a_trigger_ref_id=0, bool $a_self_eval=false)
 
static getNewAchievementsPerUser (string $a_timestamp, ?string $a_timestamp_to=null, int $a_user_id=0, int $a_self_eval=0)
 
static writeUserSkillLevelStatus (int $a_level_id, int $a_user_id, int $a_trigger_ref_id, int $a_tref_id=0, int $a_status=ilBasicSkill::ACHIEVED, bool $a_force=false, bool $a_self_eval=false, string $a_unique_identifier="", float $a_next_level_fulfilment=0.0, string $trigger_user_id="")
 
static removeAllUserSkillLevelStatusOfObject (int $a_user_id, int $a_trigger_obj_id, bool $a_self_eval=false, string $a_unique_identifier="")
 
static removeAllUserData (int $a_user_id)
 
static hasSelfEvaluated (int $a_user_id, int $a_skill_id, int $a_tref_id)
 
static getUsageInfo (array $a_cskill_ids)
 
static getCommonSkillIdForImportId (int $a_source_inst_id, int $a_skill_import_id, int $a_tref_import_id=0)
 
static getLevelIdForImportId (int $a_source_inst_id, int $a_level_import_id)
 
static getLevelIdForImportIdMatchSkill (int $a_source_inst_id, int $a_level_import_id, int $a_skill_import_id, int $a_tref_import_id=0)
 
- 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...
 

Data Fields

const ACHIEVED = 1
 
const NOT_ACHIEVED = 0
 
const EVAL_BY_OTHERS = 0
 
const EVAL_BY_SELF = 1
 
const EVAL_BY_ALL = 2
 
- Data Fields inherited from ilSkillTreeNode
const STATUS_PUBLISH = 0
 
const STATUS_DRAFT = 1
 
const STATUS_OUTDATED = 2
 

Static Protected Member Functions

static hasRecentSelfEvaluation (int $a_user_id, int $a_skill_id, int $a_tref_id=0, int $a_trigger_ref_id=0)
 
- Static Protected Member Functions inherited from ilSkillTreeNode
static _lookup (int $a_obj_id, string $a_field)
 

Protected Attributes

ilObjUser $user
 
ilSkillLevelRepository $bsc_skl_lvl_db_rep
 
ilSkillUserLevelRepository $bsc_skl_usr_lvl_db_rep
 
ilSkillTreeRepository $bsc_skl_tre_rep
 
- 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

- Protected Member Functions inherited from ilSkillTreeNode
 setCreationDate (string $a_val)
 

Detailed Description

Basic Skill.

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.ilBasicSkill.php.

Constructor & Destructor Documentation

◆ __construct()

ilBasicSkill::__construct ( int  $a_id = 0,
?ilSkillLevelRepository  $bsc_skl_lvl_db_rep = null,
?ilSkillUserLevelRepository  $bsc_skl_usr_lvl_db_rep = null,
?ilSkillTreeRepository  $bsc_skl_tre_rep = null 
)

Definition at line 42 of file class.ilBasicSkill.php.

47 {
48 global $DIC;
49
50 $this->user = $DIC->user();
51
52 if (is_null($bsc_skl_lvl_db_rep)) {
53 $this->bsc_skl_lvl_db_rep = $DIC->skills()->internal()->repo()->getLevelRepo();
54 } else {
55 $this->bsc_skl_lvl_db_rep = $bsc_skl_lvl_db_rep;
56 }
57
58 if (is_null($bsc_skl_usr_lvl_db_rep)) {
59 $this->bsc_skl_usr_lvl_db_rep = $DIC->skills()->internal()->repo()->getUserLevelRepo();
60 } else {
61 $this->bsc_skl_usr_lvl_db_rep = $bsc_skl_usr_lvl_db_rep;
62 }
63
64 if (is_null($bsc_skl_tre_rep)) {
65 $this->bsc_skl_tre_rep = $DIC->skills()->internal()->repo()->getTreeRepo();
66 } else {
67 $this->bsc_skl_tre_rep = $bsc_skl_tre_rep;
68 }
69
71 $this->setType("skll");
72 }
ilSkillTreeRepository $bsc_skl_tre_rep
ilSkillUserLevelRepository $bsc_skl_usr_lvl_db_rep
ilSkillLevelRepository $bsc_skl_lvl_db_rep
setType(string $a_type)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $bsc_skl_lvl_db_rep, $bsc_skl_tre_rep, $bsc_skl_usr_lvl_db_rep, $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilSkillTreeNode\setType(), and ILIAS\Repository\user().

+ Here is the call graph for this function:

Member Function Documentation

◆ addLevel()

ilBasicSkill::addLevel ( string  $a_title,
string  $a_description,
string  $a_import_id = "" 
)

Definition at line 120 of file class.ilBasicSkill.php.

120 : void
121 {
122 $skill_id = $this->getId();
123 $this->bsc_skl_lvl_db_rep->addLevel($skill_id, $a_title, $a_description, $a_import_id);
124 }

References ilSkillTreeNode\getId().

+ Here is the call graph for this function:

◆ copy()

ilBasicSkill::copy ( )

Copy basic skill.

Reimplemented in ilBasicSkillTemplate.

Definition at line 93 of file class.ilBasicSkill.php.

94 {
95 $skill = new ilBasicSkill();
96 $skill->setTitle($this->getTitle());
97 $skill->setDescription($this->getDescription());
98 $skill->setType($this->getType());
99 $skill->setSelfEvaluation($this->getSelfEvaluation());
100 $skill->setOrderNr($this->getOrderNr());
101 $skill->create();
102
103 $levels = $this->getLevelData();
104 if (sizeof($levels)) {
105 foreach ($levels as $item) {
106 $skill->addLevel($item["title"], $item["description"]);
107 }
108 }
109 $skill->update();
110
111 return $skill;
112 }
getLevelData(int $a_id=0)

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

+ Here is the call graph for this function:

◆ create()

ilBasicSkill::create ( )

Create skill.

Reimplemented from ilSkillTreeNode.

Definition at line 85 of file class.ilBasicSkill.php.

85 : void
86 {
87 parent::create();
88 }

◆ deleteLevel()

ilBasicSkill::deleteLevel ( int  $a_id)

Definition at line 181 of file class.ilBasicSkill.php.

181 : void
182 {
183 $this->bsc_skl_lvl_db_rep->deleteLevel($a_id);
184 }

◆ fixLevelNumbering()

ilBasicSkill::fixLevelNumbering ( )

Definition at line 186 of file class.ilBasicSkill.php.

186 : void
187 {
188 $skill_id = $this->getId();
189 $this->bsc_skl_lvl_db_rep->fixLevelNumbering($skill_id);
190 }

References ilSkillTreeNode\getId().

+ Here is the call graph for this function:

◆ getAllHistoricLevelEntriesOfUser()

ilBasicSkill::getAllHistoricLevelEntriesOfUser ( int  $a_tref_id,
int  $a_user_id = 0,
int  $a_eval_by = 0 
)

Definition at line 431 of file class.ilBasicSkill.php.

435 : array {
436 if ($a_user_id == 0) {
437 $a_user_id = $this->user->getId();
438 }
439 $skill_id = $this->getId();
440
441 return $this->bsc_skl_usr_lvl_db_rep->getAllHistoricLevelEntriesOfUser(
442 $skill_id,
443 $a_tref_id,
444 $a_user_id,
445 $a_eval_by
446 );
447 }

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getAllLevelEntriesOfUser()

ilBasicSkill::getAllLevelEntriesOfUser ( int  $a_tref_id,
int  $a_user_id = 0,
int  $a_self_eval = 0 
)

Definition at line 418 of file class.ilBasicSkill.php.

422 : array {
423 if ($a_user_id == 0) {
424 $a_user_id = $this->user->getId();
425 }
426 $skill_id = $this->getId();
427
428 return $this->bsc_skl_usr_lvl_db_rep->getAllLevelEntriesOfUser($skill_id, $a_tref_id, $a_user_id, $a_self_eval);
429 }

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getCommonSkillIdForImportId()

static ilBasicSkill::getCommonSkillIdForImportId ( int  $a_source_inst_id,
int  $a_skill_import_id,
int  $a_tref_import_id = 0 
)
static

Definition at line 628 of file class.ilBasicSkill.php.

632 : array {
633 global $DIC;
634
635 if ($a_source_inst_id == 0) {
636 return [];
637 }
638
639 $repository = $DIC->skills()->internal()->repo()->getTreeRepo();
640 return $repository->getCommonSkillIdForImportId(
641 $a_source_inst_id,
642 $a_skill_import_id,
643 $a_tref_import_id
644 );
645 }

Referenced by ilAssQuestionSkillAssignmentImporter\getSkillIdMapping(), ilSkillDataSet\importRecord(), and ilSurveyDataSet\importRecord().

+ Here is the caller graph for this function:

◆ getLastLevelEntryOfUser()

ilBasicSkill::getLastLevelEntryOfUser ( int  $a_tref_id,
int  $a_user_id,
int  $a_object_id = 0,
int  $a_self_eval = 0,
string  $trigger_user = "" 
)

Definition at line 473 of file class.ilBasicSkill.php.

479 : int {
480 if ($a_user_id == 0) {
481 $a_user_id = $this->user->getId();
482 }
483 return $this->bsc_skl_usr_lvl_db_rep->getLastLevelEntryOfUser(
484 $this->getId(),
485 $a_tref_id,
486 $a_user_id,
487 $a_object_id,
488 $a_self_eval,
489 $trigger_user
490 );
491 }

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getLastLevelPerObject()

ilBasicSkill::getLastLevelPerObject ( int  $a_tref_id,
int  $a_object_id,
int  $a_user_id = 0,
int  $a_self_eval = 0 
)

Definition at line 555 of file class.ilBasicSkill.php.

560 : int {
561 if ($a_user_id == 0) {
562 $a_user_id = $this->user->getId();
563 }
564 $skill_id = $this->getId();
565
566 return $this->bsc_skl_usr_lvl_db_rep->getLastLevelPerObject(
567 $skill_id,
568 $a_tref_id,
569 $a_object_id,
570 $a_user_id,
571 $a_self_eval
572 );
573 }

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getLastUpdatePerObject()

ilBasicSkill::getLastUpdatePerObject ( int  $a_tref_id,
int  $a_object_id,
int  $a_user_id = 0,
int  $a_self_eval = 0 
)

Definition at line 575 of file class.ilBasicSkill.php.

580 : string {
581 if ($a_user_id == 0) {
582 $a_user_id = $this->user->getId();
583 }
584 $skill_id = $this->getId();
585
586 return $this->bsc_skl_usr_lvl_db_rep->getLastUpdatePerObject(
587 $skill_id,
588 $a_tref_id,
589 $a_object_id,
590 $a_user_id,
591 $a_self_eval
592 );
593 }

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getLevelData()

ilBasicSkill::getLevelData ( int  $a_id = 0)

Definition at line 126 of file class.ilBasicSkill.php.

126 : array
127 {
128 $skill_id = $this->getId();
129
130 return $this->bsc_skl_lvl_db_rep->getLevelData($skill_id, $a_id);
131 }

References ilSkillTreeNode\getId().

Referenced by copy(), and ilBasicSkillTemplate\copy().

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

◆ getLevelIdForImportId()

static ilBasicSkill::getLevelIdForImportId ( int  $a_source_inst_id,
int  $a_level_import_id 
)
static

Definition at line 647 of file class.ilBasicSkill.php.

647 : array
648 {
649 global $DIC;
650
651 $repository = $DIC->skills()->internal()->repo()->getTreeRepo();
652
653 return $repository->getLevelIdForImportId($a_source_inst_id, $a_level_import_id);
654 }

References $DIC.

Referenced by ilTestSkillLevelThresholdImporter\getLevelIdMapping(), and ilSkillDataSet\importRecord().

+ Here is the caller graph for this function:

◆ getLevelIdForImportIdMatchSkill()

static ilBasicSkill::getLevelIdForImportIdMatchSkill ( int  $a_source_inst_id,
int  $a_level_import_id,
int  $a_skill_import_id,
int  $a_tref_import_id = 0 
)
static

Definition at line 656 of file class.ilBasicSkill.php.

661 : array {
662 $level_id_data = self::getLevelIdForImportId($a_source_inst_id, $a_level_import_id);
663 $skill_data = self::getCommonSkillIdForImportId($a_source_inst_id, $a_skill_import_id, $a_tref_import_id);
664 $matches = [];
665 foreach ($level_id_data as $l) {
666 reset($skill_data);
667 foreach ($skill_data as $s) {
668 if (ilBasicSkill::lookupLevelSkillId($l["level_id"]) == $s["skill_id"]) {
669 $matches[] = array(
670 "level_id" => $l["level_id"],
671 "creation_date" => $l["creation_date"],
672 "skill_id" => $s["skill_id"],
673 "tref_id" => $s["tref_id"]
674 );
675 }
676 }
677 }
678 return $matches;
679 }
static lookupLevelSkillId(int $a_id)
static getCommonSkillIdForImportId(int $a_source_inst_id, int $a_skill_import_id, int $a_tref_import_id=0)
static getLevelIdForImportId(int $a_source_inst_id, int $a_level_import_id)

Referenced by ilSurveyDataSet\importRecord().

+ Here is the caller graph for this function:

◆ getMaxLevel()

ilBasicSkill::getMaxLevel ( int  $a_tref_id,
int  $a_user_id = 0,
int  $a_self_eval = 0 
)

Definition at line 514 of file class.ilBasicSkill.php.

518 : int {
519 if ($a_user_id == 0) {
520 $a_user_id = $this->user->getId();
521 }
522 $skill_id = $this->getId();
523 $levels = $this->getLevelData();
524
525 return $this->bsc_skl_usr_lvl_db_rep->getMaxLevel($skill_id, $levels, $a_tref_id, $a_user_id, $a_self_eval);
526 }

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getMaxLevelPerObject()

ilBasicSkill::getMaxLevelPerObject ( int  $a_tref_id,
int  $a_object_id,
int  $a_user_id = 0,
int  $a_self_eval = 0,
string  $trigger_user = "" 
)

Definition at line 449 of file class.ilBasicSkill.php.

455 : int {
456 if ($a_user_id == 0) {
457 $a_user_id = $this->user->getId();
458 }
459 $skill_id = $this->getId();
460 $levels = $this->getLevelData();
461
462 return $this->bsc_skl_usr_lvl_db_rep->getMaxLevelPerObject(
463 $skill_id,
464 $levels,
465 $a_tref_id,
466 $a_object_id,
467 $a_user_id,
468 $a_self_eval,
469 $trigger_user
470 );
471 }

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getMaxLevelPerType()

ilBasicSkill::getMaxLevelPerType ( int  $a_tref_id,
string  $a_type,
int  $a_user_id = 0,
int  $a_self_eval = 0 
)

Definition at line 376 of file class.ilBasicSkill.php.

381 : int {
382 if ($a_user_id == 0) {
383 $a_user_id = $this->user->getId();
384 }
385 $skill_id = $this->getId();
386 $levels = $this->getLevelData();
387
388 return $this->bsc_skl_usr_lvl_db_rep->getMaxLevelPerType(
389 $skill_id,
390 $levels,
391 $a_tref_id,
392 $a_type,
393 $a_user_id,
394 $a_self_eval
395 );
396 }

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getNewAchievementsPerUser()

static ilBasicSkill::getNewAchievementsPerUser ( string  $a_timestamp,
?string  $a_timestamp_to = null,
int  $a_user_id = 0,
int  $a_self_eval = 0 
)
static

Definition at line 267 of file class.ilBasicSkill.php.

272 : array {
273 global $DIC;
274
275 $ilDB = $DIC->database();
276
277 $repository = new ilSkillUserLevelDBRepository($ilDB);
278
279 return $repository->getNewAchievementsPerUser($a_timestamp, $a_timestamp_to, $a_user_id, $a_self_eval);
280 }

Referenced by ilSkillLearningHistoryProvider\getEntries(), and ilSkillNotifications\run().

+ Here is the caller graph for this function:

◆ getNextLevelFulfilment()

ilBasicSkill::getNextLevelFulfilment ( int  $a_tref_id,
int  $a_user_id = 0,
int  $a_self_eval = 0 
)

Definition at line 528 of file class.ilBasicSkill.php.

532 : float {
533 if ($a_user_id == 0) {
534 $a_user_id = $this->user->getId();
535 }
536 $skill_id = $this->getId();
537
538 return $this->bsc_skl_usr_lvl_db_rep->getNextLevelFulfilment($skill_id, $a_tref_id, $a_user_id, $a_self_eval);
539 }

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getNextLevelFulfilmentPerObject()

ilBasicSkill::getNextLevelFulfilmentPerObject ( int  $a_tref_id,
int  $a_object_id,
int  $a_user_id = 0,
int  $a_self_eval = 0 
)

Definition at line 494 of file class.ilBasicSkill.php.

499 : float {
500 if ($a_user_id == 0) {
501 $a_user_id = $this->user->getId();
502 }
503 $skill_id = $this->getId();
504
505 return $this->bsc_skl_usr_lvl_db_rep->getNextLevelFulfilmentPerObject(
506 $skill_id,
507 $a_tref_id,
508 $a_object_id,
509 $a_user_id,
510 $a_self_eval
511 );
512 }

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getNextLevelFulfilmentPerType()

ilBasicSkill::getNextLevelFulfilmentPerType ( int  $a_tref_id,
string  $a_type,
int  $a_user_id = 0,
int  $a_self_eval = 0 
)

Definition at line 398 of file class.ilBasicSkill.php.

403 : float {
404 if ($a_user_id == 0) {
405 $a_user_id = $this->user->getId();
406 }
407 $skill_id = $this->getId();
408
409 return $this->bsc_skl_usr_lvl_db_rep->getNextLevelFulfilmentPerType(
410 $skill_id,
411 $a_tref_id,
412 $a_type,
413 $a_user_id,
414 $a_self_eval
415 );
416 }

References ILIAS\Repository\user().

+ Here is the call graph for this function:

◆ getShortTitleForCertificate()

ilBasicSkill::getShortTitleForCertificate ( )

Definition at line 606 of file class.ilBasicSkill.php.

606 : string
607 {
608 return "Skill";
609 }

◆ getSkillForLevelId()

ilBasicSkill::getSkillForLevelId ( int  $a_level_id)

Definition at line 192 of file class.ilBasicSkill.php.

192 : ?ilBasicSkill
193 {
194 return $this->bsc_skl_lvl_db_rep->getSkillForLevelId($a_level_id);
195 }
getSkillForLevelId(int $a_level_id)

References getSkillForLevelId().

Referenced by getSkillForLevelId().

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

◆ getTitleForCertificate()

ilBasicSkill::getTitleForCertificate ( )

Definition at line 601 of file class.ilBasicSkill.php.

601 : string
602 {
603 return $this->getTitle();
604 }

References ILIAS\GlobalScreen\Scope\Footer\Factory\getTitle().

+ Here is the call graph for this function:

◆ getUsageInfo()

static ilBasicSkill::getUsageInfo ( array  $a_cskill_ids)
static

Definition at line 614 of file class.ilBasicSkill.php.

614 : array
615 {
616 global $DIC;
617
618 $usage_manager = $DIC->skills()->internal()->manager()->getUsageManager();
619
620 return $usage_manager->getUsageInfoGeneric(
621 $a_cskill_ids,
622 Usage\SkillUsageManager::USER_ASSIGNED,
623 "skl_user_skill_level",
624 "user_id"
625 );
626 }

References $DIC.

◆ hasRecentSelfEvaluation()

static ilBasicSkill::hasRecentSelfEvaluation ( int  $a_user_id,
int  $a_skill_id,
int  $a_tref_id = 0,
int  $a_trigger_ref_id = 0 
)
staticprotected

Definition at line 242 of file class.ilBasicSkill.php.

247 : string {
248 global $DIC;
249
250 $ilDB = $DIC->database();
251
252 $obj_adapter = new ilSkillObjectAdapter();
253 $trigger_obj_id = ($a_trigger_ref_id > 0)
254 ? $obj_adapter->getObjIdForRefId($a_trigger_ref_id)
255 : 0;
256 $repository = new ilSkillUserLevelDBRepository($ilDB);
257
258 return $repository->hasRecentSelfEvaluation(
259 $trigger_obj_id,
260 $a_user_id,
261 $a_skill_id,
262 $a_tref_id,
263 $a_trigger_ref_id
264 );
265 }
Class ilBasicSkillObjectAdapter.

◆ hasSelfEvaluated()

static ilBasicSkill::hasSelfEvaluated ( int  $a_user_id,
int  $a_skill_id,
int  $a_tref_id 
)
static

Definition at line 541 of file class.ilBasicSkill.php.

545 : bool {
546 global $DIC;
547
548 $ilDB = $DIC->database();
549
550 $repository = new ilSkillUserLevelDBRepository($ilDB);
551
552 return $repository->hasSelfEvaluated($a_user_id, $a_skill_id, $a_tref_id);
553 }

Referenced by ilPersonalSkillsGUI\listAssignedProfile().

+ Here is the caller graph for this function:

◆ lookupLevelDescription()

static ilBasicSkill::lookupLevelDescription ( int  $a_id)
static

Definition at line 142 of file class.ilBasicSkill.php.

142 : string
143 {
144 global $DIC;
145
146 $repository = $DIC->skills()->internal()->repo()->getLevelRepo();
147
148 return $repository->lookupLevelDescription($a_id);
149 }

References $DIC.

◆ lookupLevelSkillId()

static ilBasicSkill::lookupLevelSkillId ( int  $a_id)
static

Definition at line 151 of file class.ilBasicSkill.php.

151 : int
152 {
153 global $DIC;
154
155 $repository = $DIC->skills()->internal()->repo()->getLevelRepo();
156
157 return $repository->lookupLevelSkillId($a_id);
158 }

References $DIC.

Referenced by ilSkillDataSet\importRecord().

+ Here is the caller graph for this function:

◆ lookupLevelTitle()

static ilBasicSkill::lookupLevelTitle ( int  $a_id)
static

Definition at line 133 of file class.ilBasicSkill.php.

133 : string
134 {
135 global $DIC;
136
137 $repository = $DIC->skills()->internal()->repo()->getLevelRepo();
138
139 return $repository->lookupLevelTitle($a_id);
140 }

References $DIC.

Referenced by ilPersonalSkillsGUI\getAllSuggestedResources(), ilSkillLearningHistoryProvider\getEntries(), ILIAS\Skill\Table\ProfileLevelsTable\getRecords(), ilSkillNotifications\sendMail(), ilBasicSkillGUI\setLevelHead(), ilBasicSkillTemplateGUI\setLevelHead(), and ilSkillTemplateReferenceGUI\setLevelHead().

+ Here is the caller graph for this function:

◆ read()

ilBasicSkill::read ( )

Read data from database.

Reimplemented from ilSkillTreeNode.

Definition at line 77 of file class.ilBasicSkill.php.

77 : void
78 {
79 parent::read();
80 }

◆ removeAllUserData()

static ilBasicSkill::removeAllUserData ( int  $a_user_id)
static

Definition at line 366 of file class.ilBasicSkill.php.

366 : void
367 {
368 global $DIC;
369
370 $ilDB = $DIC->database();
371
372 $repository = new ilSkillUserLevelDBRepository($ilDB);
373 $repository->removeAllUserData($a_user_id);
374 }

References $DIC, and $ilDB.

Referenced by ilSkillObjDeletionHandler\processDeletion().

+ Here is the caller graph for this function:

◆ removeAllUserSkillLevelStatusOfObject()

static ilBasicSkill::removeAllUserSkillLevelStatusOfObject ( int  $a_user_id,
int  $a_trigger_obj_id,
bool  $a_self_eval = false,
string  $a_unique_identifier = "" 
)
static

Definition at line 343 of file class.ilBasicSkill.php.

348 : bool {
349 global $DIC;
350
351 $ilDB = $DIC->database();
352
353 if ($a_trigger_obj_id == 0) {
354 return false;
355 }
356 $repository = new ilSkillUserLevelDBRepository($ilDB);
357
358 return $repository->removeAllUserSkillLevelStatusOfObject(
359 $a_user_id,
360 $a_trigger_obj_id,
361 $a_self_eval,
362 $a_unique_identifier
363 );
364 }

Referenced by ILIAS\Container\Skills\ContainerSkillManager\publishMemberSkills(), and ILIAS\Container\Skills\ContainerSkillManager\removeAllMemberSkillsFromContainer().

+ Here is the caller graph for this function:

◆ resetUserSkillLevelStatus()

static ilBasicSkill::resetUserSkillLevelStatus ( int  $a_user_id,
int  $a_skill_id,
int  $a_tref_id = 0,
int  $a_trigger_ref_id = 0,
bool  $a_self_eval = false 
)
static

Definition at line 203 of file class.ilBasicSkill.php.

209 : void {
210 global $DIC;
211
212 $ilDB = $DIC->database();
213
214 if (!$a_self_eval) {
215 throw new ilSkillException("resetUserSkillLevelStatus currently only provided for self evaluations.");
216 }
217
218 $obj_adapter = new ilSkillObjectAdapter();
219 $trigger_obj_id = ($a_trigger_ref_id > 0)
220 ? $obj_adapter->getObjIdForRefId($a_trigger_ref_id)
221 : 0;
222
223 $update = false;
224 $repository = new ilSkillUserLevelDBRepository($ilDB);
225 $status_date = $repository->hasRecentSelfEvaluation($a_user_id, $a_skill_id, $a_tref_id, $a_trigger_ref_id);
226 if ($status_date != "") {
227 $update = true;
228 }
229
230 $repository->resetUserSkillLevelStatus(
231 $update,
232 $trigger_obj_id,
233 $status_date,
234 $a_user_id,
235 $a_skill_id,
236 $a_tref_id,
237 $a_trigger_ref_id,
238 $a_self_eval
239 );
240 }
Skill exception class.

◆ updateLevelOrder()

ilBasicSkill::updateLevelOrder ( array  $order)

Definition at line 176 of file class.ilBasicSkill.php.

176 : void
177 {
178 $this->bsc_skl_lvl_db_rep->updateLevelOrder($order);
179 }

◆ writeLevelDescription()

static ilBasicSkill::writeLevelDescription ( int  $a_id,
string  $a_description 
)
static

Definition at line 168 of file class.ilBasicSkill.php.

168 : void
169 {
170 global $DIC;
171
172 $repository = $DIC->skills()->internal()->repo()->getLevelRepo();
173 $repository->writeLevelDescription($a_id, $a_description);
174 }

References $DIC.

◆ writeLevelTitle()

static ilBasicSkill::writeLevelTitle ( int  $a_id,
string  $a_title 
)
static

Definition at line 160 of file class.ilBasicSkill.php.

160 : void
161 {
162 global $DIC;
163
164 $repository = $DIC->skills()->internal()->repo()->getLevelRepo();
165 $repository->writeLevelTitle($a_id, $a_title);
166 }

References $DIC.

◆ writeUserSkillLevelStatus()

static ilBasicSkill::writeUserSkillLevelStatus ( int  $a_level_id,
int  $a_user_id,
int  $a_trigger_ref_id,
int  $a_tref_id = 0,
int  $a_status = ilBasicSkill::ACHIEVED,
bool  $a_force = false,
bool  $a_self_eval = false,
string  $a_unique_identifier = "",
float  $a_next_level_fulfilment = 0.0,
string  $trigger_user_id = "" 
)
static

Definition at line 282 of file class.ilBasicSkill.php.

293 : void {
294 global $DIC;
295
296 $ilDB = $DIC->database();
297
298 $skill_id = ilBasicSkill::lookupLevelSkillId($a_level_id);
299 $trigger_ref_id = $a_trigger_ref_id;
300 $obj_adapter = new ilSkillObjectAdapter();
301 $trigger_obj_id = $obj_adapter->getObjIdForRefId($trigger_ref_id);
302 $trigger_title = $obj_adapter->getTitleForObjId($trigger_obj_id);
303 $trigger_type = $obj_adapter->getTypeForObjId($trigger_obj_id);
304
305 $status_date = "";
306 $update = false;
307
308 // self evaluations will update, if the last self evaluation is on the same day
309 if ($a_self_eval && self::hasRecentSelfEvaluation($a_user_id, $skill_id, $a_tref_id, $trigger_ref_id)) {
310 $status_date = self::hasRecentSelfEvaluation($a_user_id, $skill_id, $a_tref_id, $trigger_ref_id);
311 if ($status_date != "") {
312 $update = true;
313 }
314 }
315
316 //next level percentage fulfilment value must be >=0 and <1
317 if (!($a_next_level_fulfilment >= 0) || !($a_next_level_fulfilment < 1)) {
318 throw new \UnexpectedValueException(
319 "Next level fulfilment must be equal to or greater than 0 and less than 1, '" .
320 $a_next_level_fulfilment . "' given."
321 );
322 }
323
324 $repository = new ilSkillUserLevelDBRepository($ilDB);
325 $repository->writeUserSkillLevelStatus(
326 $skill_id,
327 $trigger_ref_id,
328 $trigger_obj_id,
329 $trigger_title,
330 $trigger_type,
331 $update,
332 $status_date,
333 $a_level_id,
334 $a_user_id,
335 $a_tref_id,
336 $a_self_eval,
337 $a_unique_identifier,
338 $a_next_level_fulfilment,
339 $trigger_user_id
340 );
341 }
static hasRecentSelfEvaluation(int $a_user_id, int $a_skill_id, int $a_tref_id=0, int $a_trigger_ref_id=0)

Referenced by ilSkillAppEventListener\handleEvent(), ilTestSkillEvaluation\invokeSkillLevelTrigger(), ILIAS\Container\Skills\ContainerSkillManager\publishMemberSkills(), ILIAS\Skill\Personal\SelfEvaluationManager\saveSelfEvaluation(), ilSurveySkill\writeAndAddAppraiseeSkills(), ilSurveySkill\writeAndAddIndFeedbackSkills(), and ilSurveySkill\writeAndAddSelfEvalSkills().

+ Here is the caller graph for this function:

Field Documentation

◆ $bsc_skl_lvl_db_rep

ilSkillLevelRepository ilBasicSkill::$bsc_skl_lvl_db_rep
protected

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

Referenced by __construct().

◆ $bsc_skl_tre_rep

ilSkillTreeRepository ilBasicSkill::$bsc_skl_tre_rep
protected

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

Referenced by __construct().

◆ $bsc_skl_usr_lvl_db_rep

ilSkillUserLevelRepository ilBasicSkill::$bsc_skl_usr_lvl_db_rep
protected

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

Referenced by __construct().

◆ $user

ilObjUser ilBasicSkill::$user
protected

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

◆ ACHIEVED

◆ EVAL_BY_ALL

const ilBasicSkill::EVAL_BY_ALL = 2

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

◆ EVAL_BY_OTHERS

const ilBasicSkill::EVAL_BY_OTHERS = 0

Definition at line 38 of file class.ilBasicSkill.php.

◆ EVAL_BY_SELF

const ilBasicSkill::EVAL_BY_SELF = 1

Definition at line 39 of file class.ilBasicSkill.php.

Referenced by ilPersonalSkillsGUI\getSkillEntriesHeader().

◆ NOT_ACHIEVED

const ilBasicSkill::NOT_ACHIEVED = 0

Definition at line 36 of file class.ilBasicSkill.php.


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