/** * */ public function prefetchChangeLogData($ps_tablename, $pn_start, $pn_num_rows) { if (sizeof($va_row_ids = $this->getRowIDsToPrefetch($pn_start, $pn_num_rows)) == 0) { return false; } $vs_key = caMakeCacheKeyFromOptions(array_merge($va_row_ids, array('_table' => $ps_tablename))); if (self::$s_timestamp_cache['fetched'][$vs_key]) { return true; } $o_log = new ApplicationChangeLog(); if (!is_array(self::$s_timestamp_cache['created_on'][$ps_tablename])) { self::$s_timestamp_cache['created_on'][$ps_tablename] = array(); } self::$s_timestamp_cache['created_on'][$ps_tablename] += $o_log->getCreatedOnTimestampsForIDs($ps_tablename, $va_row_ids); if (!is_array(self::$s_timestamp_cache['last_changed'][$ps_tablename])) { self::$s_timestamp_cache['last_changed'][$ps_tablename] = array(); } self::$s_timestamp_cache['last_changed'][$ps_tablename] += $o_log->getLastChangeTimestampsForIDs($ps_tablename, $va_row_ids); self::$s_timestamp_cache['fetched'][$vs_key] = true; return true; }
/** * */ public function prefetchChangeLogData($ps_tablename, $pn_start, $pn_num_rows) { if (sizeof($va_row_ids = $this->getRowIDsToPrefetch($ps_tablename, $pn_start, $pn_num_rows)) == 0) { return false; } $vs_key = md5($ps_tablename . '/' . print_r($va_row_ids, true)); if ($this->opa_timestamp_cache['fetched'][$vs_key]) { return true; } $o_log = new ApplicationChangeLog(); if (!is_array($this->opa_timestamp_cache['created_on'][$ps_tablename])) { $this->opa_timestamp_cache['created_on'][$ps_tablename] = array(); } $this->opa_timestamp_cache['created_on'][$ps_tablename] += $o_log->getCreatedOnTimestampsForIDs($ps_tablename, $va_row_ids); if (!is_array($this->opa_timestamp_cache['last_changed'][$ps_tablename])) { $this->opa_timestamp_cache['last_changed'][$ps_tablename] = array(); } $this->opa_timestamp_cache['last_changed'][$ps_tablename] += $o_log->getLastChangeTimestampsForIDs($ps_tablename, $va_row_ids); $this->opa_timestamp_cache['fetched'][$vs_key] = true; return true; }