/** * @see PropertyInfoStore::removePropertyInfo * * @param PropertyId $propertyId * * @return bool */ public function removePropertyInfo(PropertyId $propertyId) { $id = $propertyId->getNumericId(); // if we don't know it, don't delete it. if (is_array($this->propertyInfo) && !array_key_exists($id, $this->propertyInfo)) { return false; } // update primary store $ok = $this->store->removePropertyInfo($propertyId); if (!$ok) { // nothing changed, nothing to do return false; } // NOTE: Even if we don't have the propertyInfo locally, we still need to // fully load it to update memcached. // Get local cached version. // NOTE: this may be stale at this point, if it was already loaded $propertyInfo = $this->getAllPropertyInfo(); // update local cache unset($propertyInfo[$id]); $this->propertyInfo = $propertyInfo; // update external cache wfDebugLog(__CLASS__, __FUNCTION__ . ': updating cache after removing property ' . $id); $this->cache->set($this->cacheKey, $propertyInfo, $this->cacheDuration); return true; }