You are here

function flag_handler_field_ops::get_flag in Flag 6

Same name and namespace in other branches
  1. 6.2 includes/flag_handler_field_ops.inc \flag_handler_field_ops::get_flag()
  2. 7.3 includes/views/flag_handler_field_ops.inc \flag_handler_field_ops::get_flag()
  3. 7.2 includes/flag_handler_field_ops.inc \flag_handler_field_ops::get_flag()

Returns the flag object associated with our field.

A field is in some relationship. This function reaches out for this relationship and reads its 'flag' option, which holds the flag name.

3 calls to flag_handler_field_ops::get_flag()
flag_handler_field_ops::pre_render in includes/flag_handler_field_ops.inc
Find out if the flag applies to each item seen on the page. It's done in a separate DB query to to avoid complexity and to make 'many to one' tests (e.g. checking user roles) possible without causing duplicate rows.
flag_handler_field_ops::query in includes/flag_handler_field_ops.inc
Override base ::query(). The purpose here is to make it possible for the render() method to know two things: what's the content ID, and whether it's flagged.
flag_handler_field_ops::render in includes/flag_handler_field_ops.inc

File

includes/flag_handler_field_ops.inc, line 21
Contains the flag Ops field handler.

Class

flag_handler_field_ops
Views field handler for the Flag operations links (flag/unflag).

Code

function get_flag() {
  $flag_name = $this->view->relationship[$this->options['relationship']]->options['flag'];
  return flag_get_flag($flag_name);
}