You are here

function flag_flag::_flag in Flag 7.2

Same name and namespace in other branches
  1. 5 flag.inc \flag_flag::_flag()
  2. 6.2 flag.inc \flag_flag::_flag()
  3. 6 flag.inc \flag_flag::_flag()

A low-level method to flag content.

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

@private

Return value

The 'fcid' column of the new {flag_content} record.

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

File

./flag.inc, line 801
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 _flag($content_id, $uid, $sid) {
  $fcid = db_insert('flag_content')
    ->fields(array(
    'fid' => $this->fid,
    'content_type' => $this->content_type,
    'content_id' => $content_id,
    'uid' => $uid,
    'sid' => $sid,
    'timestamp' => REQUEST_TIME,
  ))
    ->execute();
  $this
    ->_increase_count($content_id);
  return $fcid;
}