ILIAS
Release_4_1_x_branch Revision 61804
◀ ilDoc Overview
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Groups
Pages
class.ilNewsSubscription.php
Go to the documentation of this file.
1
<?php
2
/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4
13
class
ilNewsSubscription
14
{
21
public
static
function
_subscribe
($a_ref_id, $a_user_id)
22
{
23
global
$ilDB
;
24
25
$ilDB->manipulate(
"DELETE FROM il_news_subscription WHERE "
.
26
" ref_id = "
.$ilDB->quote($a_ref_id,
"integer"
).
" "
.
27
" AND user_id = "
.$ilDB->quote($a_user_id,
"integer"
));
28
$ilDB->manipulate(
"INSERT INTO il_news_subscription (ref_id, user_id) VALUES ("
.
29
$ilDB->quote($a_ref_id,
"integer"
).
", "
.
30
$ilDB->quote($a_user_id,
"integer"
).
")"
);
31
}
32
39
public
static
function
_unsubscribe
($a_ref_id, $a_user_id)
40
{
41
global
$ilDB
;
42
43
$ilDB->manipulate(
"DELETE FROM il_news_subscription WHERE ref_id = "
.
44
$ilDB->quote($a_ref_id,
"integer"
).
" AND user_id = "
.
45
$ilDB->quote($a_user_id,
"integer"
));
46
}
47
55
public
static
function
_hasSubscribed
($a_ref_id, $a_user_id)
56
{
57
global
$ilDB
;
58
59
$query
=
"SELECT * FROM il_news_subscription WHERE ref_id = "
.
60
$ilDB->quote($a_ref_id,
"integer"
).
" AND user_id = "
.
61
$ilDB->quote($a_user_id,
"integer"
);
62
$set = $ilDB->query(
$query
);
63
if
($rec = $ilDB->fetchAssoc($set))
64
{
65
return
true
;
66
}
67
else
68
{
69
return
false
;
70
}
71
}
72
80
public
static
function
_getSubscriptionsOfUser
($a_user_id)
81
{
82
global
$ilDB
;
83
84
$query
=
"SELECT * FROM il_news_subscription WHERE user_id = "
.
85
$ilDB->quote($a_user_id,
"integer"
);
86
$set = $ilDB->query(
$query
);
87
$ref_ids = array();
88
while
($rec = $ilDB->fetchAssoc($set))
89
{
90
$ref_ids[] = $rec[
"ref_id"
];
91
}
92
93
return
$ref_ids;
94
}
95
}
96
?>
Services
News
classes
class.ilNewsSubscription.php
Generated on Thu Apr 21 2016 19:02:55 for ILIAS by
1.8.1.2 (using
Doxyfile
)