Exemple #1
0
 /**
  * {@inheritDoc}
  */
 public function cache(BatchGeocoded $geocoded)
 {
     $this->redis->set($key = $this->getKey($geocoded->getProviderName(), $geocoded->getQuery()), $this->serialize($geocoded));
     if ($this->expire > 0) {
         $this->redis->expire($key, $this->expire);
     }
 }
Exemple #2
0
 /**
  * {@inheritDoc}
  */
 public function cache(BatchGeocoded $geocoded)
 {
     try {
         $this->collection->insert(array_merge(array('id' => $this->getKey($geocoded->getProviderName(), $geocoded->getQuery())), $this->normalize($geocoded)));
     } catch (\Exception $e) {
         throw new RuntimeException($e->getMessage());
     }
 }
 /**
  * {@inheritDoc}
  */
 public function cache(BatchGeocoded $geocoded)
 {
     $this->memcached->set($this->getKey($geocoded->getProviderName(), $geocoded->getQuery()), $this->serialize($geocoded), $this->expire);
 }