protected function spaces_controller::load_space_values in Spaces 7
Same name and namespace in other branches
- 6.3 plugins/spaces_controller.inc \spaces_controller::load_space_values()
- 7.3 plugins/spaces_controller.inc \spaces_controller::load_space_values()
Protected method that ensures a space-level override for the provided object has been loaded.
2 calls to spaces_controller::load_space_values()
- spaces_controller::load_values in plugins/
spaces_controller.inc - Wrapper around load_[environment]_values.
- spaces_controller_variable::init_overrides in plugins/
spaces_controller_variable.inc - Override of init_overrides().
1 method overrides spaces_controller::load_space_values()
- spaces_controller_context::load_space_values in plugins/
spaces_controller_context.inc - Override of load_space_values().
File
- plugins/
spaces_controller.inc, line 85
Class
- spaces_controller
- Abstract base class for a spaces controller. Classes that extend spaces_controller must implement load_original_values().
Code
protected function load_space_values($id = NULL) {
if (!$this->loaded_all['space']) {
if (!isset($id)) {
$result = db_query("\n SELECT object_id AS id, value\n FROM {spaces_overrides}\n WHERE type = :type\n AND id = :id\n AND object_type = :otype", array(
':type' => $this->space_type,
':id' => $this->space_id,
':otype' => $this->controller,
));
foreach ($result as $row) {
$this->values['space'][$row->id] = unserialize($row->value);
}
$this->loaded_all['space'] = TRUE;
}
else {
if (!isset($this->loaded['space'][$id])) {
$result = db_query("\n SELECT object_id AS id, value\n FROM {spaces_overrides}\n WHERE type = :type\n AND id = :id\n AND object_type = :otype\n AND object_id = :oid", array(
':type' => $this->space_type,
':id' => $this->space_id,
':otype' => $this->controller,
':oid' => $id,
));
foreach ($result as $row) {
$this->values['space'][$row->id] = unserialize($row->value);
}
$this->loaded['space'][$id] = TRUE;
}
}
}
}