ILIAS  release_8 Revision v8.23
ilSkillObjDeletionHandler Class Reference

Handles deletion of (user) objects. More...

+ Collaboration diagram for ilSkillObjDeletionHandler:

Public Member Functions

 __construct (int $obj_id, string $obj_type)
 
 processDeletion ()
 

Protected Attributes

int $obj_id = 0
 
string $obj_type = ""
 
SkillProfileManager $profile_manager
 
SkillProfileCompletionManager $profile_completion_manager
 

Detailed Description

Handles deletion of (user) objects.

Author
killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Constructor & Destructor Documentation

◆ __construct()

ilSkillObjDeletionHandler::__construct ( int  $obj_id,
string  $obj_type 
)

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

References $DIC, $obj_id, and $obj_type.

37  {
38  global $DIC;
39 
40  $this->obj_type = $obj_type;
41  $this->obj_id = $obj_id;
42  $this->profile_manager = $DIC->skills()->internal()->manager()->getProfileManager();
43  $this->profile_completion_manager = $DIC->skills()->internal()->manager()->getProfileCompletionManager();
44  }
global $DIC
Definition: feed.php:28

Member Function Documentation

◆ processDeletion()

ilSkillObjDeletionHandler::processDeletion ( )

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

References $ref_id, ilObject\_getAllReferences(), ilObject\_lookupType(), ilBasicSkill\removeAllUserData(), ilPersonalSkill\removeMaterials(), ilPersonalSkill\removeSkills(), and ilSkillUsage\removeUsagesFromObject().

46  : void
47  {
48  if ($this->obj_type == "usr" && ilObject::_lookupType($this->obj_id) == "usr") {
49  ilPersonalSkill::removeSkills($this->obj_id);
50  ilPersonalSkill::removeMaterials($this->obj_id);
51  $this->profile_manager->removeUserFromAllProfiles($this->obj_id);
52  $this->profile_completion_manager->deleteEntriesForUser($this->obj_id);
53  ilBasicSkill::removeAllUserData($this->obj_id);
54  }
55  if ($this->obj_type == "role" && ilObject::_lookupType($this->obj_id) == "role") {
56  $this->profile_manager->removeRoleFromAllProfiles($this->obj_id);
57  }
58  if ($this->obj_type == "crs" && ilObject::_lookupType($this->obj_id) == "crs") {
59  foreach (ilContainerReference::_getAllReferences($this->obj_id) as $ref_id) {
60  if ($ref_id != 0) {
61  $this->profile_manager->deleteProfilesFromObject($ref_id);
62  }
63  }
64  }
65  if ($this->obj_type == "grp" && ilObject::_lookupType($this->obj_id) == "grp") {
66  foreach (ilContainerReference::_getAllReferences($this->obj_id) as $ref_id) {
67  if ($ref_id != 0) {
68  $this->profile_manager->deleteProfilesFromObject($ref_id);
69  }
70  }
71  }
73  }
static removeSkills(int $a_user_id)
static removeUsagesFromObject(int $a_obj_id)
static _getAllReferences(int $id)
get all reference ids for object ID
$ref_id
Definition: ltiauth.php:67
static removeAllUserData(int $a_user_id)
static removeMaterials(int $a_user_id)
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

Field Documentation

◆ $obj_id

int ilSkillObjDeletionHandler::$obj_id = 0
protected

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

Referenced by __construct().

◆ $obj_type

string ilSkillObjDeletionHandler::$obj_type = ""
protected

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

Referenced by __construct().

◆ $profile_completion_manager

SkillProfileCompletionManager ilSkillObjDeletionHandler::$profile_completion_manager
protected

Definition at line 34 of file class.ilSkillObjDeletionHandler.php.

◆ $profile_manager

SkillProfileManager ilSkillObjDeletionHandler::$profile_manager
protected

Definition at line 33 of file class.ilSkillObjDeletionHandler.php.


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