Doctrine\Common\Cache\RiakCache::doContains PHP Method

doContains() protected method

protected doContains ( $id )
    protected function doContains($id)
    {
        try {
            // We only need the HEAD, not the entire object
            $input = new Input\GetInput();
            $input->setReturnHead(true);
            $response = $this->bucket->get($id, $input);
            // No objects found
            if (!$response->hasObject()) {
                return false;
            }
            $object = $response->getFirstObject();
            // Check for expired object
            if ($this->isExpired($object)) {
                $this->bucket->delete($object);
                return false;
            }
            return true;
        } catch (Exception\RiakException $e) {
            // Do nothing
        }
        return false;
    }