Example #1
0
 /**
  * {@inheritDoc}
  */
 public function newInstance()
 {
     $batchGeocoded = new BatchGeocoded();
     $batchGeocoded->setProviderName($this->providerName);
     $batchGeocoded->setQuery($this->query);
     $batchGeocoded->setExceptionMessage($this->exception);
     return $batchGeocoded;
 }
Example #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;
 }
Example #3
0
 /**
  * {@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;
 }
Example #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;
 }