don't record null key values

darcs-hash:20080926164021-5ed1f-833db670e260c68fc02b0a2a60a2829f247742a1.gz
This commit is contained in:
Evan Prodromou 2008-09-26 12:40:21 -04:00
parent f01f006615
commit 98add9803b

View File

@ -112,10 +112,13 @@ class Memcached_DataObject extends DB_DataObject
if ($type == 'K') {
$primary[] = $key;
} else {
$c->set($this->cacheKey($this->tableName(), $key, $this->$key),
$v = $this->$key;
if (!is_null($v)) {
$c->set($this->cacheKey($this->tableName(), $key, $v),
$this);
}
}
}
# XXX: figure out what to do with compound pkeys
if (count($primary) == 1) {
$key = $primary[0];