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') { if ($type == 'K') {
$primary[] = $key; $primary[] = $key;
} else { } 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); $this);
} }
} }
}
# XXX: figure out what to do with compound pkeys # XXX: figure out what to do with compound pkeys
if (count($primary) == 1) { if (count($primary) == 1) {
$key = $primary[0]; $key = $primary[0];