summaryrefslogtreecommitdiffstats
path: root/lib/class/database_object.abstract.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-03-08 13:28:43 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-03-08 13:28:43 +0000
commit37a348127fc68a8e3e8858873bc4df47d40a1760 (patch)
tree0cea9f357efdb076d3b1714424e485959177392e /lib/class/database_object.abstract.php
parented15ee4a9c06ab2a3c706f4f6225820fae730cc1 (diff)
downloadampache-37a348127fc68a8e3e8858873bc4df47d40a1760.tar.gz
ampache-37a348127fc68a8e3e8858873bc4df47d40a1760.tar.bz2
ampache-37a348127fc68a8e3e8858873bc4df47d40a1760.zip
fixed catalog functions and corrected negative value caching
Diffstat (limited to 'lib/class/database_object.abstract.php')
-rw-r--r--lib/class/database_object.abstract.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/class/database_object.abstract.php b/lib/class/database_object.abstract.php
index ed83d198..e26b22df 100644
--- a/lib/class/database_object.abstract.php
+++ b/lib/class/database_object.abstract.php
@@ -63,7 +63,7 @@ abstract class database_object {
public static function is_cached($index,$id) {
// Make sure we've got some parents here before we dive below
- if (!isset(self::$object_cache) || !isset(self::$object_cache[$index])) { return false; }
+ if (!isset(self::$object_cache[$index])) { return false; }
return isset(self::$object_cache[$index][$id]);
@@ -76,8 +76,7 @@ abstract class database_object {
public static function get_from_cache($index,$id) {
// Check if the object is set
- if (isset(self::$object_cache)
- && isset(self::$object_cache[$index])
+ if (isset(self::$object_cache[$index])
&& isset(self::$object_cache[$index][$id])
) {
@@ -95,8 +94,9 @@ abstract class database_object {
*/
public static function add_to_cache($index,$id,$data) {
- self::$object_cache[$index][$id] = $data;
-
+ $value = is_null($data) ? false : $data;
+ self::$object_cache[$index][$id] = $value;
+
} // add_to_cache
} // end database_object