]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Managed_DataObject.php
pkeyGet is now static and more similar to getKV
[quix0rs-gnu-social.git] / classes / Managed_DataObject.php
index cc982cf63c18fda776e3893115eb59bfb5e3cab5..e473a2bf03d512685133d83a5fae776d7ef4f378 100644 (file)
@@ -41,9 +41,25 @@ abstract class Managed_DataObject extends Memcached_DataObject
      */
     static function getKV($k,$v=NULL)
     {
-        return parent::getKV(get_called_class(),$k,$v);
+        return parent::getClassKV(get_called_class(), $k, $v);
     }
 
+    /**
+     * Get an instance by compound key
+     *
+     * This is a utility method to get a single instance with a given set of
+     * key-value pairs. Usually used for the primary key for a compound key; thus
+     * the name.
+     *
+     * @param array $kv array of key-value mappings
+     *
+     * @return get_called_class() object if found, or null for no hits
+     *
+     */
+    static function pkeyGet($kv)
+    {
+        return parent::pkeyGetClass(get_called_class(), $kv);
+    }
 
     /**
      * get/set an associative array of table columns