ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilECSParticipantSettingsRepository Class Reference
+ Collaboration diagram for ilECSParticipantSettingsRepository:

Public Member Functions

 __construct ()
 
 getExportableParticipants ($a_type)
 Get participants which are enabled and export is allowed. More...
 
 getServersContaingExports ()
 Get server ids which allow an export. More...
 

Private Attributes

ilDBInterface $db
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilECSParticipantSettingsRepository::__construct ( )

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

References $DIC.

29  {
30  global $DIC;
31 
32  $this->db = $DIC->database();
33  }
global $DIC
Definition: shib_login.php:22

Member Function Documentation

◆ getExportableParticipants()

ilECSParticipantSettingsRepository::getExportableParticipants (   $a_type)

Get participants which are enabled and export is allowed.

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

References $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

38  : array
39  {
40  $query = 'SELECT sid,mid,export_types FROM ecs_part_settings ep ' .
41  'JOIN ecs_server es ON ep.sid = es.server_id ' .
42  'WHERE export = ' . $this->db->quote(1, 'integer') . ' ' .
43  'AND active = ' . $this->db->quote(1, 'integer') . ' ' .
44  'ORDER BY cname,es.title';
45 
46  $res = $this->db->query($query);
47  $mids = array();
48  $counter = 0;
49  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
50  if (in_array($a_type, (array) unserialize($row->export_types, ['allowed_classes' => true]), true)) {
51  $mids[$counter]['sid'] = (int)$row->sid;
52  $mids[$counter]['mid'] = (int)$row->mid;
53  $counter++;
54  }
55  }
56  return $mids;
57  }
$res
Definition: ltiservices.php:66
+ Here is the call graph for this function:

◆ getServersContaingExports()

ilECSParticipantSettingsRepository::getServersContaingExports ( )

Get server ids which allow an export.

Definition at line 62 of file class.ilECSParticipantSettingsRepository.php.

References $res, ilDBConstants\FETCHMODE_OBJECT, and ILIAS\Repository\int().

62  : array
63  {
64  $query = 'SELECT DISTINCT(sid) FROM ecs_part_settings ep ' .
65  'JOIN ecs_server es ON ep.sid = es.server_id ' .
66  'WHERE export = ' . $this->db->quote(1, 'integer') . ' ' .
67  'AND active = ' . $this->db->quote(1, 'integer') . ' ';
68  $res = $this->db->query($query);
69  $sids = array();
70  while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
71  $sids[] = (int) $row->sid;
72  }
73  return $sids;
74  }
$res
Definition: ltiservices.php:66
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilECSParticipantSettingsRepository::$db
private

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


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