ElggEntity::storeInPersistedCache PHP Method

storeInPersistedCache() public method

Cache the entity in a persisted cache
public storeInPersistedCache ( ElggSharedMemoryCache $cache, integer $last_action ) : void
$cache ElggSharedMemoryCache Memcache or null cache
$last_action integer Last action time
return void
    public function storeInPersistedCache(\ElggSharedMemoryCache $cache, $last_action = 0)
    {
        $tmp = $this->volatile;
        // don't store volatile data
        $this->volatile = [];
        if ($last_action) {
            $this->attributes['last_action'] = (int) $last_action;
        }
        $cache->save($this->guid, $this);
        $this->volatile = $tmp;
    }