aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/sites.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/sites.php')
-rw-r--r--engine/lib/sites.php20
1 files changed, 17 insertions, 3 deletions
diff --git a/engine/lib/sites.php b/engine/lib/sites.php
index 9823f097a..89a95812e 100644
--- a/engine/lib/sites.php
+++ b/engine/lib/sites.php
@@ -212,8 +212,6 @@
*/
public function getCollections($subtype="", $limit = 10, $offset = 0) { get_site_collections($this->getGUID(), $subtype, $limit, $offset); }
-
-
}
/**
@@ -227,7 +225,23 @@
$guid = (int)$guid;
- return get_data_row("SELECT * from {$CONFIG->dbprefix}sites_entity where guid=$guid");
+ $row = retrieve_cached_entity_row($guid);
+ if ($row)
+ {
+ // We have already cached this object, so retrieve its value from the cache
+ if ($CONFIG->debug)
+ error_log("** Retrieving sub part of GUID:$guid from cache");
+
+ return $row;
+ }
+ else
+ {
+ // Object not cached, load it.
+ if ($CONFIG->debug)
+ error_log("** Sub part of GUID:$guid loaded from DB");
+
+ return get_data_row("SELECT * from {$CONFIG->dbprefix}sites_entity where guid=$guid");
+ }
}
/**