You are here

function commons_follow_get_subscription_flags_ids in Drupal Commons 7.3

Get subscriptions flag IDs.

Parameters

$content_type: Optional. The type of content for which to load the flags. Usually 'node'.

$content_subtype: Optional. The node type for which to load the flags.

$account: Optional. The user accont to filter available flags. If not set, all flags for will this node will be returned.

$reset: Optional. Reset the internal query cache.

Return value

$flags An array of the structure [fid] = flag_object.

See also

flag_get_flags()

4 calls to commons_follow_get_subscription_flags_ids()
commons_follow_group_commons_follow_get_nids in modules/commons/commons_follow/commons_follow_group/commons_follow_group.module
Implements hook_commons_follow_get_nids().
commons_follow_node_commons_follow_get_nids in modules/commons/commons_follow/commons_follow_node/commons_follow_node.module
Implements hook_commons_follow_get_nids().
commons_follow_term_commons_follow_get_nids in modules/commons/commons_follow/commons_follow_term/commons_follow_term.module
Implements hook_commons_follow_get_nids().
commons_follow_user_commons_follow_get_nids in modules/commons/commons_follow/commons_follow_user/commons_follow_user.module
Implements hook_commons_follow_get_nids().

File

modules/commons/commons_follow/commons_follow.module, line 241

Code

function commons_follow_get_subscription_flags_ids($content_type = NULL, $content_subtype = NULL, $account = NULL, $reset = FALSE) {
  if (!module_exists('message_subscribe')) {

    // Requires message_subscribe module.
    return;
  }
  $flags = message_subscribe_flag_get_flags($content_type, $content_subtype, $account, $reset);
  $flag_ids = array();
  foreach ($flags as $flag) {
    $flag_ids[] = $flag->fid;
  }
  return $flag_ids;
}