ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 

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.

References $server.

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

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.

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().

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  }
static _getAllReferences($a_id)
get all reference ids of object
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static lookupObjIdsByContentId($a_content_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMid()

ilECSEnrolmentStatusCommandQueueHandler::getMid ( )

Get mid.

Returns
type

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

References $mid.

◆ getServer()

ilECSEnrolmentStatusCommandQueueHandler::getServer ( )

Get server.

Returns
ilECSServerSetting

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

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.

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

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  }
static parseImportId($a_import_id)
Parse an ilias import id Typically of type il_[IL_INST_ID]_[OBJ_TYPE]_[OBJ_ID] returns array( 'orig' ...
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
doUpdate($a_usr_id, ilECSEnrolmentStatus $status)
Perform update.
Connector for course member ressource.
+ 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

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

Referenced by __construct(), and getServer().


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