You are here

function flag_flag::_is_flagged in Flag 7.2

Same name and namespace in other branches
  1. 5 flag.inc \flag_flag::_is_flagged()
  2. 6.2 flag.inc \flag_flag::_is_flagged()
  3. 6 flag.inc \flag_flag::_is_flagged()
  4. 7.3 includes/flag/flag_flag.inc \flag_flag::_is_flagged()

Determines if a certain user has flagged this content.

You probably shouldn't call this raw private method: call the is_flagged() method instead.

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.

@private

Return value

If the content is flagged, returns the value of the 'fcid' column. Else, returns FALSE.

1 call to flag_flag::_is_flagged()
flag_flag::flag in ./flag.inc
Flags, or unflags, an item.

File

./flag.inc, line 779
Implements various flags. Uses object oriented style inspired by that of Views 2.

Class

flag_flag
This abstract class represents a flag, or, in Views 2 terminology, "a handler".

Code

function _is_flagged($content_id, $uid, $sid) {
  return db_select('flag_content', 'fc')
    ->fields('fc', array(
    'fcid',
  ))
    ->condition('fid', $this->fid)
    ->condition('uid', $uid)
    ->condition('sid', $sid)
    ->condition('content_id', $content_id)
    ->execute()
    ->fetchField();
}