This class handles news subscriptions of users.
More...
Static Public Member Functions |
static | _subscribe ($a_ref_id, $a_user_id) |
| Subscribe a user to an object (ref id).
|
static | _unsubscribe ($a_ref_id, $a_user_id) |
| Unsubscribe a user from an object (ref id).
|
static | _hasSubscribed ($a_ref_id, $a_user_id) |
| Check whether user has subscribed to an object.
|
static | _getSubscriptionsOfUser ($a_user_id) |
| Get subscriptions of user.
|
Detailed Description
This class handles news subscriptions of users.
- Author
- Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
- Version
- $Id$
Definition at line 13 of file class.ilNewsSubscription.php.
Member Function Documentation
static ilNewsSubscription::_getSubscriptionsOfUser |
( |
|
$a_user_id | ) |
|
|
static |
Get subscriptions of user.
- Parameters
-
int | $a_ref_id | ref id |
int | $a_user_id | user id |
- Returns
- boolean has subscribed true/false
Definition at line 80 of file class.ilNewsSubscription.php.
References $ilDB, and $query.
Referenced by ilNewsItem\_getNewsItemsOfUser().
{
$query =
"SELECT * FROM il_news_subscription WHERE user_id = ".
$ilDB->quote($a_user_id, "integer");
$ref_ids = array();
while ($rec = $ilDB->fetchAssoc($set))
{
$ref_ids[] = $rec["ref_id"];
}
return $ref_ids;
}
static ilNewsSubscription::_hasSubscribed |
( |
|
$a_ref_id, |
|
|
|
$a_user_id |
|
) |
| |
|
static |
Check whether user has subscribed to an object.
- Parameters
-
int | $a_ref_id | ref id |
int | $a_user_id | user id |
- Returns
- boolean has subscribed true/false
Definition at line 55 of file class.ilNewsSubscription.php.
References $ilDB, and $query.
{
$query =
"SELECT * FROM il_news_subscription WHERE ref_id = ".
$ilDB->quote($a_ref_id, "integer")." AND user_id = ".
$ilDB->quote($a_user_id, "integer");
if ($rec = $ilDB->fetchAssoc($set))
{
return true;
}
else
{
return false;
}
}
static ilNewsSubscription::_subscribe |
( |
|
$a_ref_id, |
|
|
|
$a_user_id |
|
) |
| |
|
static |
Subscribe a user to an object (ref id).
- Parameters
-
int | $a_ref_id | ref id |
int | $a_user_id | user id |
Definition at line 21 of file class.ilNewsSubscription.php.
References $ilDB.
Referenced by ilNewsForContextBlockGUI\subscribeNews().
{
$ilDB->manipulate("DELETE FROM il_news_subscription WHERE ".
" ref_id = ".$ilDB->quote($a_ref_id, "integer")." ".
" AND user_id = ".$ilDB->quote($a_user_id, "integer"));
$ilDB->manipulate("INSERT INTO il_news_subscription (ref_id, user_id) VALUES (".
$ilDB->quote($a_ref_id, "integer").", ".
$ilDB->quote($a_user_id, "integer").")");
}
static ilNewsSubscription::_unsubscribe |
( |
|
$a_ref_id, |
|
|
|
$a_user_id |
|
) |
| |
|
static |
Unsubscribe a user from an object (ref id).
- Parameters
-
int | $a_ref_id | ref id |
int | $a_user_id | user id |
Definition at line 39 of file class.ilNewsSubscription.php.
References $ilDB.
Referenced by ilNewsForContextBlockGUI\unsubscribeNews().
{
$ilDB->manipulate("DELETE FROM il_news_subscription WHERE ref_id = ".
$ilDB->quote($a_ref_id, "integer")." AND user_id = ".
$ilDB->quote($a_user_id, "integer"));
}
The documentation for this class was generated from the following file: