ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
◀ 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
$ilDB
;
67
68
$query
=
'DELETE FROM ecs_community '
.
69
'WHERE sid = '
. $ilDB->quote($a_server_id,
'integer'
);
70
$ilDB->manipulate(
$query
);
71
}
72
77
public
function
getCommunities
()
78
{
79
return
(
array
)
$this->communities
;
80
}
81
85
public
function
lookupOwnId
($a_server_id, $a_mid)
86
{
87
foreach
($this->
getCommunities
() as $com) {
88
if
($com->getServerId() == $a_server_id) {
89
if
(in_array($a_mid, $com->getMids())) {
90
return
$com->getOwnId();
91
}
92
}
93
}
94
return
0;
95
}
96
102
public
function
lookupTitle
($a_server_id, $a_mid)
103
{
104
foreach
($this->
getCommunities
() as $com) {
105
if
($com->getServerId() == $a_server_id) {
106
if
(in_array($a_mid, $com->getMids())) {
107
return
$com->getCommunityName();
108
}
109
}
110
}
111
return
''
;
112
}
113
117
private
function
read
()
118
{
119
global
$ilDB
;
120
121
$query
=
'SELECT sid,cid FROM ecs_community '
;
122
$res
= $ilDB->query(
$query
);
123
while
(
$row
=
$res
->fetchRow(
ilDBConstants::FETCHMODE_OBJECT
)) {
124
$this->communities[] =
ilECSCommunityCache::getInstance
(
$row
->sid,
$row
->cid);
125
}
126
return
true
;
127
}
128
}
ilECSCommunitiesCache\$instance
static $instance
Definition:
class.ilECSCommunitiesCache.php:36
ilECSCommunitiesCache\getCommunities
getCommunities()
Get communities.
Definition:
class.ilECSCommunitiesCache.php:77
ilECSCommunitiesCache\read
read()
Read comunities.
Definition:
class.ilECSCommunitiesCache.php:117
ilECSCommunitiesCache\lookupTitle
lookupTitle($a_server_id, $a_mid)
Lookup community title.
Definition:
class.ilECSCommunitiesCache.php:102
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
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
ilECSCommunitiesCache\lookupOwnId
lookupOwnId($a_server_id, $a_mid)
Lookup own mid of the community of a mid.
Definition:
class.ilECSCommunitiesCache.php:85
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
ilECSCommunityCache\getInstance
static getInstance($a_sid, $a_cid)
Get instance.
Definition:
class.ilECSCommunityCache.php:64
ilDBConstants\FETCHMODE_OBJECT
const FETCHMODE_OBJECT
Definition:
class.ilDBConstants.php:13
$row
$row
Definition:
10autofilter-selection-1.php:74
ilECSCommunitiesCache
+-----------------------------------------------------------------------——+ | ILIAS open source | +...
Definition:
class.ilECSCommunitiesCache.php:34
Services
WebServices
ECS
classes
class.ilECSCommunitiesCache.php
Generated on Sat Mar 1 2025 19:01:42 for ILIAS by
1.8.13 (using
Doxyfile
)