/** * {@inheritdoc } */ public function set($key, $value, $ttl = null) { $tKey = $this->getKey($key); $tValue = $this->pack($value); if (!$ttl) { $ttl = $this->ttl; } $item = array('_id' => $tKey, 'value' => $tValue, 'ttl' => $this->getTtl($ttl)); $this->collection->update(array('_id' => $tKey), $item, array('upsert' => true)); }