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.

Thanks to using a cache, inquiring several different flags about the same item results in only one SQL query.

Parameters

$uid: Optional. The user ID whose flags we're checking. If none given, the current user will be used.

Return value

TRUE if the content is flagged, FALSE otherwise.

1 call to flag_flag::is_flagged()
flag_flag::access in ./flag.inc
Determines whether the user may flag, or unflag, the given content.

File

./flag.inc, line 737
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 = NULL, $sid = NULL) {
  return (bool) $this
    ->get_flagging_record($content_id, $uid, $sid);
}