key = $key; $this->expire = $expire; $this->memcached = $memcached; } /** * {@inheritdoc} */ public function load() { $contents = $this->memcached->get($this->key); if ($contents !== false) { $this->setFromStorage($contents); } } /** * {@inheritdoc} */ public function save() { $contents = $this->getForStorage(); $expiration = $this->expire === null ? 0 : time() + $this->expire; $this->memcached->set($this->key, $contents, $expiration); } }