/** * Applies the result of the load query. * * @param resource $result - The db result resource * @param int $load_query - The query that the result is from */ protected function applyLoad($result, $load_query) { if (self::QUERY_WIDGETS == $load_query) { $widgets = $locations = array(); while ($widget = vB::$db->fetch_array($result)) { $widgets[] = $widget['widgetid']; $locations[$widget['column']][$widget['index']] = $widget['widgetid']; } $this->setWidgets($widgets); $this->setLocations($locations); // mark widget info as loaded $this->loaded_info |= self::INFO_WIDGETS; return true; } return parent::applyLoad($result, $load_query); }
/** * Applies the result of the load query. * Child classes should extend or override to determine what was loaded based * on $required_query and $required_info. * * This method should only ever be used directly after performing the queries so * that $this->required_info accurately reflects the query result. * * @param resource $result - The db result resource * @param int $load_query - The query that the result is from */ protected function applyLoad($result, $load_query) { return parent::applyLoad($result, $load_query); }
/** * Applies the result of the load query. * * @param resource $result - The db result resource * @param int $load_query - The query that the result is from */ protected function applyLoad($result, $load_query) { if (self::QUERY_CONFIG == $load_query) { $node_config = $instance_config = array(); while ($cvar = vB::$db->fetch_array($result)) { if ($cvar('instance')) { $instance_config[$cvar['name']] = ($cvar['serialized'] ? unserialize($cvar['value']) : $cvar['value']); } else { $node_config[$cvar['name']] = ($cvar['serialized'] ? unserialize($cvar['value']) : $cvar['value']); } } // merge widget instance config with node config $config = array_merge($instance_config, $node_config); $this->setConfig($config, true); // mark config as loaded $this->loaded_info |= self::INFO_CONFIG; return true; } return parent::applyLoad($result, $load_query); }