function subscriptions_get in Subscriptions 7
Same name and namespace in other branches
- 5.2 subscriptions.module \subscriptions_get()
- 6 subscriptions.module \subscriptions_get()
- 2.0.x subscriptions.module.old.php \subscriptions_get()
Get subscriptions.
Parameters
array $params: Array of parameters for the query.
Return value
array Array of subscriptions indexed by uid, module, field, value, author_uid.
File
- ./
subscriptions.module, line 726 - Subscriptions module.
Code
function subscriptions_get(array $params) {
$subscriptions = array();
// Build query
$query = db_select('subscriptions', 's');
$query
->fields('s');
foreach ($params as $field => $value) {
$query
->condition($field, $value);
}
foreach ($query
->execute() as $s) {
$subscriptions[$s->recipient_uid][$s->module][$s->field][$s->value][$s->author_uid] = 1;
}
return $subscriptions;
}