ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilNewsSubscription Class Reference

This class handles news subscriptions of users. More...

+ Collaboration diagram for ilNewsSubscription:

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 33 of file class.ilNewsSubscription.php.

Member Function Documentation

static ilNewsSubscription::_getSubscriptionsOfUser (   $a_user_id)
static

Get subscriptions of user.

Parameters
int$a_ref_idref id
int$a_user_iduser id
Returns
boolean has subscribed true/false

Definition at line 99 of file class.ilNewsSubscription.php.

References DB_FETCHMODE_ASSOC.

Referenced by ilNewsItem\_getNewsItemsOfUser().

{
global $ilDB;
$query = "SELECT * FROM il_news_subscription WHERE user_id = ".
$ilDB->quote($a_user_id);
$set = $ilDB->query($query);
$ref_ids = array();
while ($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
{
$ref_ids[] = $rec["ref_id"];
}
return $ref_ids;
}

+ Here is the caller graph for this function:

static ilNewsSubscription::_hasSubscribed (   $a_ref_id,
  $a_user_id 
)
static

Check whether user has subscribed to an object.

Parameters
int$a_ref_idref id
int$a_user_iduser id
Returns
boolean has subscribed true/false

Definition at line 74 of file class.ilNewsSubscription.php.

References DB_FETCHMODE_ASSOC.

{
global $ilDB;
$query = "SELECT * FROM il_news_subscription WHERE ref_id = ".
$ilDB->quote($a_ref_id)." AND user_id = ".
$ilDB->quote($a_user_id);
$set = $ilDB->query($query);
if ($rec = $set->fetchRow(DB_FETCHMODE_ASSOC))
{
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_idref id
int$a_user_iduser id

Definition at line 41 of file class.ilNewsSubscription.php.

Referenced by ilNewsForContextBlockGUI\subscribeNews().

{
global $ilDB;
$query = "REPLACE INTO il_news_subscription (ref_id, user_id) VALUES (".
$ilDB->quote($a_ref_id).", ".
$ilDB->quote($a_user_id).")";
$ilDB->query($query);
}

+ Here is the caller graph for this function:

static ilNewsSubscription::_unsubscribe (   $a_ref_id,
  $a_user_id 
)
static

Unsubscribe a user from an object (ref id).

Parameters
int$a_ref_idref id
int$a_user_iduser id

Definition at line 57 of file class.ilNewsSubscription.php.

Referenced by ilNewsForContextBlockGUI\unsubscribeNews().

{
global $ilDB;
$query = "DELETE FROM il_news_subscription WHERE ref_id = ".
$ilDB->quote($a_ref_id)." AND user_id = ".
$ilDB->quote($a_user_id);
$ilDB->query($query);
}

+ Here is the caller graph for this function:


The documentation for this class was generated from the following file: