/**
  * {@inheritDoc}
  */
 public function newInstance()
 {
     $batchGeocoded = new BatchGeocoded();
     $batchGeocoded->setProviderName($this->providerName);
     $batchGeocoded->setQuery($this->query);
     $batchGeocoded->setExceptionMessage($this->exception);
     return $batchGeocoded;
 }
Exemple #2
0
 /**
  * {@inheritDoc}
  */
 public function isCached($providerName, $query)
 {
     if (!$this->redis->exists($key = $this->getKey($providerName, $query))) {
         return false;
     }
     $cached = new BatchGeocoded();
     $cached->fromArray($this->deserialize($this->redis->get($key)));
     return $cached;
 }
 /**
  * {@inheritDoc}
  */
 public function isCached($providerName, $query)
 {
     if (!($result = $this->memcached->get($this->getKey($providerName, $query)))) {
         return false;
     }
     $cached = new BatchGeocoded();
     $cached->fromArray($this->deserialize($result));
     return $cached;
 }
Exemple #4
0
 /**
  * {@inheritDoc}
  */
 public function isCached($providerName, $query)
 {
     $result = $this->collection->findOne(array('id' => $this->getKey($providerName, $query)));
     if (null === $result) {
         return false;
     }
     $cached = new BatchGeocoded();
     $cached->fromArray($result);
     return $cached;
 }