You are here

function _flag_lists_is_flagged in Flag Lists 7

Same name and namespace in other branches
  1. 6 flag_lists.module \_flag_lists_is_flagged()
  2. 7.3 flag_lists.module \_flag_lists_is_flagged()

Returns TRUE if a certain user has flagged this content.

This method is similar to is_flagged() except that it does direct SQL and doesn't do caching. Use it when you want to not affect the cache, or to bypass it.

3 calls to _flag_lists_is_flagged()
flag_lists_do_flag in ./flag_lists.module
Flags, or unflags, an item.
flag_lists_page in ./flag_lists.module
Menu callback for (un)flagging a node.
theme_flag_lists_list in ./flag_lists.module

File

./flag_lists.module, line 1490
The Flag Lists module.

Code

function _flag_lists_is_flagged($flag, $content_id, $uid, $sid) {
  $query = db_select('flag_lists_content')
    ->condition('fid', $flag->fid)
    ->condition('uid', $uid)
    ->condition('sid', $sid)
    ->condition('content_id', $content_id);
  $query
    ->addField('flag_lists_content', 'fid');
  return $query
    ->execute()
    ->fetchField();
}