public function findOne($collectionName, $filter = [], array $options = []) { return $this->bridge->findOne($this->cName($collectionName), $filter, $options); }
/** * Read the cache for the given key. * * @param string $key Cache key * * @return string|bool Cache content, or bool false if the key is not found in the cache. */ public function read($key) { $result = $this->mongoInstance->findOne(self::collection, ['key' => $key]); if (is_array($result) && isset($result['content'])) { $this->remainingTtl = $result['ttl']->toDateTime()->getTimestamp() - time(); return $result['content']; } $this->remainingTtl = 0; return false; }