Elgg\Cache\Pool::invalidate PHP Method

invalidate() public method

Implementations must: * Immediately consider the value stale * Recalculate the value at the next opportunity
public invalidate ( string | integer $key ) : void
$key string | integer A plain string ID for the cache entry to invalidate.
return void
    public function invalidate($key);

Usage Example

Ejemplo n.º 1
0
 /**
  * Delete URL data from DB and cache
  *
  * @param string $url URL
  * @return bool
  */
 public function delete($url)
 {
     $this->cache->invalidate(sha1($url));
     $dbprefix = elgg_get_config('dbprefix');
     $result = delete_data("\n\t\t\t\tDELETE FROM {$dbprefix}scraper_data\n\t\t\t\tWHERE url = :url\n\t\t", [':url' => (string) $url]);
     return (bool) $result;
 }