handle one-argument calls to staticGet

darcs-hash:20080926163357-5ed1f-49bd6d85d34d0e6ac3514c06d99e5b5b9a78b0fc.gz
This commit is contained in:
Evan Prodromou 2008-09-26 12:33:57 -04:00
parent 88b19d8ab5
commit d3f8cd39a1

View File

@ -24,6 +24,11 @@ require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
class Memcached_DataObject extends DB_DataObject class Memcached_DataObject extends DB_DataObject
{ {
function &staticGet($cls, $k, $v=NULL) { function &staticGet($cls, $k, $v=NULL) {
if (is_null($v)) {
$v = $k;
$keys = $cls->keys();
$k = $keys[0];
}
$i = Memcached_DataObject::getcached($cls, $k, $v); $i = Memcached_DataObject::getcached($cls, $k, $v);
if (!is_null($i)) { if (!is_null($i)) {
return $i; return $i;