]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
handle one-argument calls to staticGet
authorEvan Prodromou <evan@controlyourself.ca>
Fri, 26 Sep 2008 16:33:57 +0000 (12:33 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Fri, 26 Sep 2008 16:33:57 +0000 (12:33 -0400)
darcs-hash:20080926163357-5ed1f-49bd6d85d34d0e6ac3514c06d99e5b5b9a78b0fc.gz

classes/Memcached_DataObject.php

index ab56d2474e08376b81072fcac47fc5fca7d5879e..ff1ca0bdfeb76be18f0cbd1c957cdc854d440bce 100644 (file)
@@ -24,6 +24,11 @@ require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
 class Memcached_DataObject extends DB_DataObject 
 {
     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);
                if (!is_null($i)) {
                        return $i;