ILIAS  release_8 Revision v8.24
ilECSEnrolmentStatusCommandQueueHandler Class Reference
+ Inheritance diagram for ilECSEnrolmentStatusCommandQueueHandler:
+ Collaboration diagram for ilECSEnrolmentStatusCommandQueueHandler:

Public Member Functions

 __construct (ilECSSetting $server)
 Constructor. More...
 
 getServer ()
 Get server. More...
 
 getMid ()
 Get mid. More...
 
 handleCreate (ilECSSetting $server, $a_content_id)
 Handle create. More...
 
 handleDelete (ilECSSetting $server, $a_content_id)
 Handle delete. More...
 
 handleUpdate (ilECSSetting $server, $a_content_id)
 Handle update. More...
 
- Public Member Functions inherited from ilECSCommandQueueHandler
 handleCreate (ilECSSetting $server, int $a_content_id)
 Handle create event. More...
 
 handleUpdate (ilECSSetting $server, int $a_content_id)
 Handle update. More...
 
 handleDelete (ilECSSetting $server, int $a_content_id)
 Handle delete action. More...
 

Protected Member Functions

 doUpdate ($a_usr_id, ilECSEnrolmentStatus $status)
 Perform update. More...
 

Protected Attributes

ilRecommendedContentManager $recommended_content_manager
 

Private Attributes

ilECSSetting $server
 
int $mid = 0
 
ilLogger $logger
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilECSEnrolmentStatusCommandQueueHandler::__construct ( ilECSSetting  $server)

Constructor.

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

36 {
37 global $DIC;
38
39 $this->logger = $DIC->logger()->wsrv();
40 $this->server = $server;
41 $this->recommended_content_manager = new ilRecommendedContentManager();
42 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28

References $DIC, $server, and ILIAS\Repository\logger().

+ Here is the call graph for this function:

Member Function Documentation

◆ doUpdate()

ilECSEnrolmentStatusCommandQueueHandler::doUpdate (   $a_usr_id,
ilECSEnrolmentStatus  $status 
)
protected

Perform update.

Definition at line 108 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

108 : bool
109 {
110 $obj_ids = ilECSImportManager::getInstance()->lookupObjIdsByContentId($status->getId());
111 $obj_id = end($obj_ids);
112 $ref_ids = ilObject::_getAllReferences($obj_id);
113 $ref_id = end($ref_ids);
114
115
116 if (!$ref_id) {
117 // Remote object not found
118 return true;
119 }
120
121 switch ($status->getStatus()) {
123 // nothing todo in the moment: maybe send mail
124 break;
125
127 $this->logger->info(': Add recommended content: ' . $a_usr_id . ' ' . $ref_id . ' ' . $obj_id);
128 // deactivated for now, see discussion at
129 // https://docu.ilias.de/goto_docu_wiki_wpage_5620_1357.html
130 //$this->recommended_content_manager->addObjectRecommendation($a_usr_id, $ref_id);
131 break;
132
137 $this->logger->info(': Remove recommended content: ' . $a_usr_id . ' ' . $ref_id . ' ' . $obj_id);
138 $this->recommended_content_manager->removeObjectRecommendation($a_usr_id, $ref_id);
139 break;
140 }
141 return true;
142 }
static getInstance()
Get the singleton instance of this ilECSImportManager.
static _getAllReferences(int $id)
get all reference ids for object ID
$ref_id
Definition: ltiauth.php:67

References $ref_id, ilObject\_getAllReferences(), ilECSEnrolmentStatus\getId(), ilECSImportManager\getInstance(), ilECSEnrolmentStatus\getStatus(), ILIAS\Repository\logger(), ilECSEnrolmentStatus\STATUS_ACCOUNT_DEACTIVATED, ilECSEnrolmentStatus\STATUS_ACTIVE, ilECSEnrolmentStatus\STATUS_DENIED, ilECSEnrolmentStatus\STATUS_PENDING, ilECSEnrolmentStatus\STATUS_REJECTED, and ilECSEnrolmentStatus\STATUS_UNSUBSCRIBED.

Referenced by handleCreate().

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

◆ getMid()

ilECSEnrolmentStatusCommandQueueHandler::getMid ( )

◆ getServer()

ilECSEnrolmentStatusCommandQueueHandler::getServer ( )

Get server.

Definition at line 47 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

48 {
49 return $this->server;
50 }

References $server.

◆ handleCreate()

ilECSEnrolmentStatusCommandQueueHandler::handleCreate ( ilECSSetting  $server,
  $a_content_id 
)

Handle create.

Definition at line 63 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

63 : bool
64 {
65 try {
66 $enrolment_con = new ilECSEnrolmentStatusConnector($server);
67 $status = $enrolment_con->getEnrolmentStatus($a_content_id);
68 $this->logger->debug(print_r($status, true));
69 $this->logger->debug($status->getPersonIdType());
70 $this->logger->debug($status->getPersonId());
71 $i = $status->getPersonIdType();
73 $id_arr = ilUtil::parseImportId($status->getPersonId());
74 $this->logger->debug('Handling status change to ' . $status->getStatus() . ' for user ' . $id_arr['id']);
75 $this->doUpdate($id_arr['id'], $status);
76 } else {
77 $this->logger->debug('Not implemented yes: person id type: ' . $status->getPersonIdType());
78 }
79 } catch (ilECSConnectorException $e) {
80 $this->logger->error('Enrollment status change failed with message: ' . $e->getMessage());
81 }
82 return true;
83 }
doUpdate($a_usr_id, ilECSEnrolmentStatus $status)
Perform update.
Connector for course member ressource.
static parseImportId(string $a_import_id)
Parse an ilias import id Typically of type il_[IL_INST_ID]_[OBJ_TYPE]_[OBJ_ID] returns array( 'orig' ...
$i
Definition: metadata.php:41

References Vendor\Package\$e, $i, $server, doUpdate(), ilECSEnrolmentStatus\ID_UID, ILIAS\Repository\logger(), and ilUtil\parseImportId().

+ Here is the call graph for this function:

◆ handleDelete()

ilECSEnrolmentStatusCommandQueueHandler::handleDelete ( ilECSSetting  $server,
  $a_content_id 
)

Handle delete.

Definition at line 88 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

88 : bool
89 {
90 // nothing todo
91 return true;
92 }

◆ handleUpdate()

ilECSEnrolmentStatusCommandQueueHandler::handleUpdate ( ilECSSetting  $server,
  $a_content_id 
)

Handle update.

Definition at line 98 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

98 : bool
99 {
100 // Shouldn't happen
101 return true;
102 }

Field Documentation

◆ $logger

ilLogger ilECSEnrolmentStatusCommandQueueHandler::$logger
private

◆ $mid

int ilECSEnrolmentStatusCommandQueueHandler::$mid = 0
private

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

Referenced by getMid().

◆ $recommended_content_manager

ilRecommendedContentManager ilECSEnrolmentStatusCommandQueueHandler::$recommended_content_manager
protected

◆ $server

ilECSSetting ilECSEnrolmentStatusCommandQueueHandler::$server
private

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