ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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 = ""
 
Profile SkillProfileManager $profile_manager
 
Profile SkillProfileCompletionManager $profile_completion_manager
 
Personal PersonalSkillManager $personal_manager
 
Personal AssignedMaterialManager $assigned_material_manager
 
Usage SkillUsageManager $usage_manager
 

Detailed Description

Handles deletion of (user) objects.

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

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

Constructor & Destructor Documentation

◆ __construct()

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

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

References $DIC, $obj_id, and $obj_type.

43  {
44  global $DIC;
45 
46  $this->obj_type = $obj_type;
47  $this->obj_id = $obj_id;
48  $this->profile_manager = $DIC->skills()->internal()->manager()->getProfileManager();
49  $this->profile_completion_manager = $DIC->skills()->internal()->manager()->getProfileCompletionManager();
50  $this->personal_manager = $DIC->skills()->internal()->manager()->getPersonalSkillManager();
51  $this->assigned_material_manager = $DIC->skills()->internal()->manager()->getAssignedMaterialManager();
52  $this->usage_manager = $DIC->skills()->internal()->manager()->getUsageManager();
53  }
global $DIC
Definition: shib_login.php:25

Member Function Documentation

◆ processDeletion()

ilSkillObjDeletionHandler::processDeletion ( )

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

References $ref_id, ilObject\_getAllReferences(), ilObject\_lookupType(), and ilBasicSkill\removeAllUserData().

55  : void
56  {
57  if ($this->obj_type == "usr" && ilObject::_lookupType($this->obj_id) == "usr") {
58  $this->personal_manager->removePersonalSkillsForUser($this->obj_id);
59  $this->assigned_material_manager->removeAssignedMaterialsForUser($this->obj_id);
60  $this->profile_manager->removeUserFromAllProfiles($this->obj_id);
61  $this->profile_completion_manager->deleteEntriesForUser($this->obj_id);
62  ilBasicSkill::removeAllUserData($this->obj_id);
63  return;
64  } elseif ($this->obj_type == "role" && ilObject::_lookupType($this->obj_id) == "role") {
65  $this->profile_manager->removeRoleFromAllProfiles($this->obj_id);
66  return;
67  } elseif ($this->obj_type == "crs" && ilObject::_lookupType($this->obj_id) == "crs") {
68  foreach (ilContainerReference::_getAllReferences($this->obj_id) as $ref_id) {
69  if ($ref_id != 0) {
70  $this->profile_manager->deleteProfilesFromObject($ref_id);
71  }
72  }
73  } elseif ($this->obj_type == "grp" && ilObject::_lookupType($this->obj_id) == "grp") {
74  foreach (ilContainerReference::_getAllReferences($this->obj_id) as $ref_id) {
75  if ($ref_id != 0) {
76  $this->profile_manager->deleteProfilesFromObject($ref_id);
77  }
78  }
79  }
80  $this->usage_manager->removeUsagesFromObject($this->obj_id);
81  }
static _getAllReferences(int $id)
get all reference ids for object ID
$ref_id
Definition: ltiauth.php:66
static removeAllUserData(int $a_user_id)
static _lookupType(int $id, bool $reference=false)
+ Here is the call graph for this function:

Field Documentation

◆ $assigned_material_manager

Personal AssignedMaterialManager ilSkillObjDeletionHandler::$assigned_material_manager
protected

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

◆ $obj_id

int ilSkillObjDeletionHandler::$obj_id = 0
protected

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

Referenced by __construct().

◆ $obj_type

string ilSkillObjDeletionHandler::$obj_type = ""
protected

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

Referenced by __construct().

◆ $personal_manager

Personal PersonalSkillManager ilSkillObjDeletionHandler::$personal_manager
protected

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

◆ $profile_completion_manager

Profile SkillProfileCompletionManager ilSkillObjDeletionHandler::$profile_completion_manager
protected

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

◆ $profile_manager

Profile SkillProfileManager ilSkillObjDeletionHandler::$profile_manager
protected

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

◆ $usage_manager

Usage SkillUsageManager ilSkillObjDeletionHandler::$usage_manager
protected

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


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