You are here

public function views_db_object::set_item_option in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 includes/view.inc \views_db_object::set_item_option()
  2. 6.2 includes/view.inc \views_db_object::set_item_option()

Set an option on an item.

Use this only if you have just 1 or 2 options to set; if you have many, consider getting the item, adding the options and doing set_item yourself.

File

includes/view.inc, line 2606
views_objects Objects that represent a View or part of a view

Class

views_db_object
Base class for views' database objects.

Code

public function set_item_option($display_id, $type, $id, $option, $value) {
  $item = $this
    ->get_item($display_id, $type, $id);
  $item[$option] = $value;
  $this
    ->set_item($display_id, $type, $id, $item);
}