You are here

protected function spaces_controller::load_space_values in Spaces 6.3

Same name and namespace in other branches
  1. 7.3 plugins/spaces_controller.inc \spaces_controller::load_space_values()
  2. 7 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 = '%s'\n            AND id = '%s'\n            AND object_type = '%s'", $this->space_type, $this->space_id, $this->controller);
      while ($row = db_fetch_object($result)) {
        $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 = '%s'\n            AND id = '%s'\n            AND object_type = '%s'\n            AND object_id = '%s'", $this->space_type, $this->space_id, $this->controller, $id);
        while ($row = db_fetch_object($result)) {
          $this->values['space'][$row->id] = unserialize($row->value);
        }
        $this->loaded['space'][$id] = TRUE;
      }
    }
  }
}