ILIAS  release_7 Revision v7.30-3-g800a261c036
ilECSEnrolmentStatusCommandQueueHandler Class Reference

Description of class. More...

+ Inheritance diagram for ilECSEnrolmentStatusCommandQueueHandler:
+ Collaboration diagram for ilECSEnrolmentStatusCommandQueueHandler:

Public Member Functions

 __construct (ilECSSetting $server)
 Constructor. More...
 
 getServer ()
 Get server. More...
 
 getMid ()
 Get mid. More...
 
 checkAllocationActivation (ilECSSetting $server, $a_content_id)
 Check if course allocation is activated for one recipient of the. 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...
 
 handleCreate (ilECSSetting $server, $a_content_id)
 Handle create event. More...
 
 handleUpdate (ilECSSetting $server, $a_content_id)
 Handle update. More...
 
 handleDelete (ilECSSetting $server, $a_content_id)
 Handle delete action. More...
 

Protected Member Functions

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

Protected Attributes

 $recommended_content_manager
 

Private Attributes

 $server = null
 
 $mid = 0
 

Detailed Description

Description of class.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

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

Constructor & Destructor Documentation

◆ __construct()

ilECSEnrolmentStatusCommandQueueHandler::__construct ( ilECSSetting  $server)

Constructor.

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

29 {
30 $this->server = $server;
31 $this->recommended_content_manager = new ilRecommendedContentManager();
32 }
Recommended content manager (business logic)

References $server.

Member Function Documentation

◆ checkAllocationActivation()

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

Check if course allocation is activated for one recipient of the.

Parameters
ilECSSetting$server
type$a_content_id

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

58 {
59 }

◆ doUpdate()

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

Perform update.

Parameters
type$a_content_id
type$course

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

125 {
126 include_once './Services/WebServices/ECS/classes/class.ilECSImport.php';
127 $obj_ids = ilECSImport::lookupObjIdsByContentId($status->getId());
128 $obj_id = end($obj_ids);
129 $ref_ids = ilObject::_getAllReferences($obj_id);
130 $ref_id = end($ref_ids);
131
132
133 if (!$ref_id) {
134 // Remote object not found
135 return true;
136 }
137
138 switch ($status->getStatus()) {
140 // nothing todo in the moment: maybe send mail
141 break;
142
144 $GLOBALS['DIC']['ilLog']->write(__METHOD__ . ': Add recommended content: ' . $a_usr_id . ' ' . $ref_id . ' ' . $obj_id);
145 // deactivated for now, see discussion at
146 // https://docu.ilias.de/goto_docu_wiki_wpage_5620_1357.html
147 //$this->recommended_content_manager->addObjectRecommendation($a_usr_id, $ref_id);
148 break;
149
154 $GLOBALS['DIC']['ilLog']->write(__METHOD__ . ': Remove recommended content: ' . $a_usr_id . ' ' . $ref_id . ' ' . $obj_id);
155 $this->recommended_content_manager->removeObjectRecommendation($a_usr_id, $ref_id);
156 break;
157 }
158 return true;
159 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static lookupObjIdsByContentId($a_content_id)
static _getAllReferences($a_id)
get all reference ids of object

References $GLOBALS, ilObject\_getAllReferences(), ilECSEnrolmentStatus\getId(), ilECSEnrolmentStatus\getStatus(), ilECSImport\lookupObjIdsByContentId(), 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.

Returns
ilECSServerSetting

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

39 {
40 return $this->server;
41 }

References $server.

◆ handleCreate()

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

Handle create.

Parameters
ilECSSetting$server
type$a_content_id

Implements ilECSCommandQueueHandler.

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

68 {
69 try {
70 include_once './Services/WebServices/ECS/classes/Connectors/class.ilECSEnrolmentStatus.php';
71 include_once './Services/WebServices/ECS/classes/Connectors/class.ilECSEnrolmentStatusConnector.php';
72 $enrolment_con = new ilECSEnrolmentStatusConnector($server);
73 $status = $enrolment_con->getEnrolmentStatus($a_content_id);
74 $GLOBALS['DIC']['ilLog']->write(__METHOD__ . ': ' . print_r($status, true));
75 $GLOBALS['DIC']['ilLog']->write(__METHOD__ . ': ' . $status->getPersonIdType());
76 $GLOBALS['DIC']['ilLog']->write(__METHOD__ . ': ' . $status->getPersonId());
77 switch ($status->getPersonIdType()) {
79 $id_arr = ilUtil::parseImportId($status->getPersonId());
80 $GLOBALS['DIC']['ilLog']->write(__METHOD__ . ': Handling status change to ' . $status->getStatus() . ' for user ' . $id_arr['id']);
81 $this->doUpdate($id_arr['id'], $status);
82 break;
83
84
85
86 default:
87 $GLOBALS['DIC']['ilLog']->write(__METHOD__ . ': not implemented yes: person id type: ' . $status->getPersonIdType());
88 break;
89 }
90 } catch (ilECSConnectorException $e) {
91 $GLOBALS['DIC']['ilLog']->write(__METHOD__ . ': Enrolment status change failed with messsage: ' . $e->getMessage());
92 }
93 return true;
94 }
doUpdate($a_usr_id, ilECSEnrolmentStatus $status)
Perform update.
Connector for course member ressource.
static parseImportId($a_import_id)
Parse an ilias import id Typically of type il_[IL_INST_ID]_[OBJ_TYPE]_[OBJ_ID] returns array( 'orig' ...

References Vendor\Package\$e, $GLOBALS, $server, doUpdate(), ilECSEnrolmentStatus\ID_UID, and ilUtil\parseImportId().

+ Here is the call graph for this function:

◆ handleDelete()

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

Handle delete.

Parameters
ilECSSetting$server
type$a_content_id

Implements ilECSCommandQueueHandler.

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

102 {
103 // nothing todo
104 return true;
105 }

◆ handleUpdate()

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

Handle update.

Parameters
ilECSSetting$server
type$a_content_id

Implements ilECSCommandQueueHandler.

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

113 {
114 // Shouldn't happen
115 return true;
116 }

Field Documentation

◆ $mid

ilECSEnrolmentStatusCommandQueueHandler::$mid = 0
private

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

Referenced by getMid().

◆ $recommended_content_manager

ilECSEnrolmentStatusCommandQueueHandler::$recommended_content_manager
protected

◆ $server

ilECSEnrolmentStatusCommandQueueHandler::$server = null
private

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