X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=plugins%2FSample%2FUser_greeting_count.php;h=fc0cbd28ff72a9e3b88d816efb5f57821e10d9a7;hb=6a848bcc8ac37066f7c4941132195d2d67d3b376;hp=77fb9afebbdcb159ea9b7b44ea83608e9c1382b8;hpb=1348c6e81995d9cae5ad4a4803723750ecb462c2;p=quix0rs-gnu-social.git diff --git a/plugins/Sample/User_greeting_count.php b/plugins/Sample/User_greeting_count.php index 77fb9afebb..fc0cbd28ff 100644 --- a/plugins/Sample/User_greeting_count.php +++ b/plugins/Sample/User_greeting_count.php @@ -94,13 +94,32 @@ class User_greeting_count extends Memcached_DataObject /** * return key definitions for DB_DataObject * - * DB_DataObject needs to know about keys that the table has; this function - * defines them. + * DB_DataObject needs to know about keys that the table has, since it + * won't appear in StatusNet's own keys list. In most cases, this will + * simply reference your keyTypes() function. * - * @return array key definitions + * @return array list of key field names */ function keys() + { + return array_keys($this->keyTypes()); + } + + /** + * return key definitions for Memcached_DataObject + * + * Our caching system uses the same key definitions, but uses a different + * method to get them. This key information is used to store and clear + * cached data, so be sure to list any key that will be used for static + * lookups. + * + * @return array associative array of key definitions, field name to type: + * 'K' for primary key: for compound keys, add an entry for each component; + * 'U' for unique keys: compound keys are not well supported here. + */ + + function keyTypes() { return array('user_id' => 'K'); }