ILIAS
trunk Revision v11.0_alpha-3011-gc6b235a2e85
◀ ilDoc Overview
class.ilECSParticipantSettingsRepository.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
24
class
ilECSParticipantSettingsRepository
25
{
26
private
ilDBInterface
$db
;
27
28
public
function
__construct
()
29
{
30
global
$DIC
;
31
32
$this->db =
$DIC
->database();
33
}
34
38
public
function
getExportableParticipants
($a_type): 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
}
58
62
public
function
getServersContaingExports
(): 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
}
75
76
// Code below is unused according to eclipse. keep around if not true, otherwise remove
77
// /**
78
// * Delete by server
79
// * @global $ilDB
80
// * @param int $a_server_id
81
// */
82
// public static function deleteByServer($a_server_id)
83
// {
84
// global $DIC;
85
86
// $ilDB = $DIC['ilDB'];
87
88
// $query = 'DELETE from ecs_part_settings ' .
89
// 'WHERE sid = ' . $this->db->quote($a_server_id, 'integer');
90
// $this->db->manipulate($query);
91
// }
92
}
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:29
ilECSParticipantSettingsRepository
Definition:
class.ilECSParticipantSettingsRepository.php:25
ilECSParticipantSettingsRepository\__construct
__construct()
Definition:
class.ilECSParticipantSettingsRepository.php:28
ilECSParticipantSettingsRepository\getServersContaingExports
getServersContaingExports()
Get server ids which allow an export.
Definition:
class.ilECSParticipantSettingsRepository.php:62
ilECSParticipantSettingsRepository\$db
ilDBInterface $db
Definition:
class.ilECSParticipantSettingsRepository.php:26
ilECSParticipantSettingsRepository\getExportableParticipants
getExportableParticipants($a_type)
Get participants which are enabled and export is allowed.
Definition:
class.ilECSParticipantSettingsRepository.php:38
ilDBInterface
Interface ilDBInterface.
Definition:
interface.ilDBInterface.php:30
$res
$res
Definition:
ltiservices.php:69
ILIAS\Repository\int
int(string $key)
Definition:
trait.BaseGUIRequest.php:61
$DIC
global $DIC
Definition:
shib_login.php:26
$counter
$counter
Definition:
shib_logout.php:170
components
ILIAS
WebServices
ECS
classes
class.ilECSParticipantSettingsRepository.php
Generated on Sat Oct 18 2025 23:05:00 for ILIAS by
1.9.4 (using
Doxyfile
)