/** * @see PropertyInfoStore::setPropertyInfo * * @param PropertyId $propertyId * @param array $info * * @throws InvalidArgumentException */ public function setPropertyInfo(PropertyId $propertyId, array $info) { if (!isset($info[PropertyInfoStore::KEY_DATA_TYPE])) { throw new InvalidArgumentException('Missing required info field: ' . PropertyInfoStore::KEY_DATA_TYPE); } // update primary store $this->store->setPropertyInfo($propertyId, $info); // 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(); $id = $propertyId->getNumericId(); // update local cache $propertyInfo[$id] = $info; $this->propertyInfo = $propertyInfo; // update external cache wfDebugLog(__CLASS__, __FUNCTION__ . ': updating cache after updating property ' . $id); $this->cache->set($this->cacheKey, $propertyInfo, $this->cacheDuration); }