function views_db_object::set_item
3.x view.inc | views_db_object::set_item($display_id, $type, $id, $item) |
2.x view.inc | views_db_object::set_item($display_id, $type, $id, $item) |
Set the configuration of an item (field/sort/filter/etc) on a given display.
Pass in NULL for the $item to remove an item.
1 call to views_db_object::set_item()
- views_db_object::set_item_option in includes/
view.inc - Set an option on an item.
File
- includes/
view.inc, line 2514 - Provides the view object type and associated methods.
Class
- views_db_object
- Base class for views' database objects.
Code
function set_item($display_id, $type, $id, $item) {
// Get info about the types so we can get the right data.
$types = views_object_types();
// Initialize the display
$this->set_display($display_id);
// Get the existing configuration
$fields = $this->display[$display_id]->handler->get_option($types[$type]['plural']);
if (isset($item)) {
$fields[$id] = $item;
}
else {
unset($fields[$id]);
}
// Store.
$this->display[$display_id]->handler->set_option($types[$type]['plural'], $fields);
}