X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FUser_im_prefs.php;h=75be8969e05d7e3da8a25b6de180f1d371c03a78;hb=9182481edd5d7aa4a9f23a3c624046f168518116;hp=8ecdfe9fab74494d3e29ea1a7069066de872ebce;hpb=39392e03a71d94d6b984033b994b417edfc2d8d6;p=quix0rs-gnu-social.git diff --git a/classes/User_im_prefs.php b/classes/User_im_prefs.php index 8ecdfe9fab..75be8969e0 100644 --- a/classes/User_im_prefs.php +++ b/classes/User_im_prefs.php @@ -68,4 +68,27 @@ class User_im_prefs extends Memcached_DataObject { return array(false,false); } + + /** + * We have two compound keys with unique constraints: + * (transport, user_id) which is our primary key, and + * (transport, screenname) which is an additional constraint. + * + * Currently there's not a way to represent that second key + * in the general keys list, so we're adding it here to the + * list of keys to use for caching, ensuring that it gets + * cleared as well when we change. + * + * @return array of cache keys + */ + function _allCacheKeys() + { + $ukeys = 'transport,screenname'; + $uvals = $this->transport . ',' . $this->screenname; + + $ckeys = parent::_allCacheKeys(); + $ckeys[] = $this->cacheKey($this->tableName(), $ukeys, $uvals); + return $ckeys; + } + }