diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2008-09-26 12:30:30 -0400 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2008-09-26 12:30:30 -0400 |
commit | 88b19d8ab50307b7b16ad9937a7c147bbb945347 (patch) | |
tree | 8fba38f06afaafd44af95c3a2efc587688f1e6c2 /classes/Memcached_DataObject.php | |
parent | 156207d58d41066bb43826d9e038c8ff44c9195f (diff) |
better deletes and key names
darcs-hash:20080926163030-5ed1f-c2d375d8a8c2097456ffb3e09e55daacae2cc903.gz
Diffstat (limited to 'classes/Memcached_DataObject.php')
-rw-r--r-- | classes/Memcached_DataObject.php | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index 12e55af21..ab56d2474 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -71,9 +71,7 @@ class Memcached_DataObject extends DB_DataObject } static function cacheKey($cls, $k, $v) { - return common_cache_key(strtolower($cls) . ':' . - $k . ':' . - $v); + return common_cache_key(strtolower($cls).':'.$k.':'.$v); } static function getcached($cls, $k, $v) { @@ -100,7 +98,8 @@ class Memcached_DataObject extends DB_DataObject return false; } else { $primary = array(); - $types = ksort($this->keyTypes()); + $types = $this->keyTypes(); + ksort($types); foreach ($types as $key => $type) { if ($type == 'K') { $primary[] = $key; @@ -124,20 +123,19 @@ class Memcached_DataObject extends DB_DataObject return false; } else { $primary = array(); - $types = ksort($this->keyTypes()); + $types = $this->keyTypes(); + ksort($types); foreach ($types as $key => $type) { if ($type == 'K') { $primary[] = $this->$key; } else { - $c->delete($this->cacheKey($this->tableName(), $key, $this->$key), - $this); + $c->delete($this->cacheKey($this->tableName(), $key, $this->$key)); } } # XXX: figure out what to do with compound pkeys if (count($primary) == 1) { $key = $primary[0]; - $c->delete($this->cacheKey($this->tableName(), $key, $this->$key), - $this); + $c->delete($this->cacheKey($this->tableName(), $key, $this->$key)); } } } |