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