Get primary key for default value in Memcached_DataObject::staticGet()
This commit is contained in:
parent
5e61ec5e01
commit
ce5b44158e
|
@ -34,11 +34,12 @@ class Memcached_DataObject extends Safe_DataObject
|
|||
{
|
||||
if (is_null($v)) {
|
||||
$v = $k;
|
||||
// XXX: HACK!
|
||||
$i = new $cls;
|
||||
$keys = $i->keys();
|
||||
$keys = self::pkeyCols($cls);
|
||||
if (count($keys) > 1) {
|
||||
// FIXME: maybe call pkeyGet() ourselves?
|
||||
throw new Exception('Use pkeyGet() for compound primary keys');
|
||||
}
|
||||
$k = $keys[0];
|
||||
unset($i);
|
||||
}
|
||||
$i = Memcached_DataObject::getcached($cls, $k, $v);
|
||||
if ($i === false) { // false == cache miss
|
||||
|
|
Loading…
Reference in New Issue
Block a user