ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
class.ilECSCommunitiesCache.php
Go to the documentation of this file.
1
<?
php
24
include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityCache.php'
;
25
34
class
ilECSCommunitiesCache
35
{
36
private
static
$instance
= null;
37
38
private
$communities
= array();
39
43
protected
function
__construct
()
44
{
45
$this->
read
();
46
}
47
52
public
static
function
getInstance
()
53
{
54
if
(isset(self::$instance)) {
55
return
self::$instance;
56
}
57
return
self::$instance =
new
ilECSCommunitiesCache
();
58
}
59
64
public
static
function
delete
($a_server_id)
65
{
66
global
$DIC
;
67
68
$ilDB
= $DIC[
'ilDB'
];
69
70
$query
=
'DELETE FROM ecs_community '
.
71
'WHERE sid = '
.
$ilDB
->quote($a_server_id,
'integer'
);
72
$ilDB
->manipulate(
$query
);
73
}
74
79
public
function
getCommunities
()
80
{
81
return
(array)
$this->communities
;
82
}
83
87
public
function
lookupOwnId
($a_server_id, $a_mid)
88
{
89
foreach
($this->
getCommunities
() as $com) {
90
if
($com->getServerId() == $a_server_id) {
91
if
(in_array($a_mid, $com->getMids())) {
92
return
$com->getOwnId();
93
}
94
}
95
}
96
return
0;
97
}
98
104
public
function
lookupTitle
($a_server_id, $a_mid)
105
{
106
foreach
($this->
getCommunities
() as $com) {
107
if
($com->getServerId() == $a_server_id) {
108
if
(in_array($a_mid, $com->getMids())) {
109
return
$com->getCommunityName();
110
}
111
}
112
}
113
return
''
;
114
}
115
119
private
function
read
()
120
{
121
global
$DIC
;
122
123
$ilDB
= $DIC[
'ilDB'
];
124
125
$query
=
'SELECT sid,cid FROM ecs_community '
;
126
$res
=
$ilDB
->query(
$query
);
127
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
128
$this->communities[] =
ilECSCommunityCache::getInstance
(
$row
->sid,
$row
->cid);
129
}
130
return
true
;
131
}
132
}
ilECSCommunitiesCache\$instance
static $instance
Definition:
class.ilECSCommunitiesCache.php:36
ilECSCommunitiesCache\getCommunities
getCommunities()
Get communities.
Definition:
class.ilECSCommunitiesCache.php:79
$DIC
global $DIC
Definition:
saml.php:7
ilECSCommunitiesCache\read
read()
Read comunities.
Definition:
class.ilECSCommunitiesCache.php:119
ilECSCommunitiesCache\lookupTitle
lookupTitle($a_server_id, $a_mid)
Lookup community title.
Definition:
class.ilECSCommunitiesCache.php:104
ilECSCommunitiesCache\__construct
__construct()
Singleton constructor.
Definition:
class.ilECSCommunitiesCache.php:43
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
ilECSCommunitiesCache\$communities
$communities
Definition:
class.ilECSCommunitiesCache.php:38
$query
$query
Definition:
proxy_ylocal.php:13
ilECSCommunitiesCache\getInstance
static getInstance()
Singleton instance.
Definition:
class.ilECSCommunitiesCache.php:52
$row
$row
Definition:
migrateto20.php:360
ilECSCommunitiesCache\lookupOwnId
lookupOwnId($a_server_id, $a_mid)
Lookup own mid of the community of a mid.
Definition:
class.ilECSCommunitiesCache.php:87
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilECSCommunityCache\getInstance
static getInstance($a_sid, $a_cid)
Get instance.
Definition:
class.ilECSCommunityCache.php:64
php
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
ilECSCommunitiesCache
+-----------------------------------------------------------------------——+ | ILIAS open source | +...
Definition:
class.ilECSCommunitiesCache.php:34
Services
WebServices
ECS
classes
class.ilECSCommunitiesCache.php
Generated on Thu Jan 16 2025 19:02:34 for ILIAS by
1.8.13 (using
Doxyfile
)