ILIAS  release_8 Revision v8.23
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 27 of file class.ilECSParticipantSettingsRepository.php.

References $DIC.

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

Member Function Documentation

◆ getExportableParticipants()

ilECSParticipantSettingsRepository::getExportableParticipants (   $a_type)

Get participants which are enabled and export is allowed.

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

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

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

◆ getServersContaingExports()

ilECSParticipantSettingsRepository::getServersContaingExports ( )

Get server ids which allow an export.

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

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

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

Field Documentation

◆ $db

ilDBInterface ilECSParticipantSettingsRepository::$db
private

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


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