You are here

function flag_rules_action_fetch_content_by_user in Flag 6.2

Base action implementation: Fetch content flagged by a user.

1 string reference to 'flag_rules_action_fetch_content_by_user'
flag_rules_action_info in includes/flag.rules.inc
Implementation of hook_rules_action_info().

File

includes/flag.rules.inc, line 263
Rules integration for the Flag module.

Code

function flag_rules_action_fetch_content_by_user($flag, $user) {
  $result = db_select('flag_content', 'fc')
    ->fields('fc', array(
    'content_id',
  ))
    ->condition('content_type', $flag->content_type)
    ->condition('uid', $user->uid)
    ->condition('fid', $flag->fid)
    ->execute();
  $flagged = $result
    ->fetchCol();
  return array(
    'content_flagged_by_user' => $flagged,
  );
}