lib/Doctrine/DBAL/Connection.php
public function executeCacheQuery($query, $params, $types, QueryCacheProfile $qcp)
    {
        $resultCache = $qcp->getResultCacheDriver() ?? $this->_config->getResultCacheImpl();

        if ($resultCache === null) {
            throw CacheException::noResultDriverConfigured();
        }

        $connectionParams = $this->getParams();
        unset($connectionParams['platform']);

        [$cacheKey, $realKey] = $qcp->generateCacheKeys($query, $params, $types, $connectionParams);

        // fetch the row pointers entry
        $data = $resultCache->fetch($cacheKey);

        if ($data !== false) {
            // is the real key part of this row pointers map or is the cache only pointing to other cache keys?
            if (isset($data[$realKey])) {
                $stmt = new ArrayStatement($data[$realKey]);
            } elseif (array_key_exists($realKey, $data)) {
                $stmt = new ArrayStatement([]);
            }
        }

        if (! isset($stmt)) {
            $stmt = new ResultCacheStatement($this->executeQuery($query, $params, $types), $resultCache, $cacheKey, $realKey, $qcp->getLifetime());
        }

        $stmt->setFetchMode($this->defaultFetchMode);

        return $stmt;
    }
public function executeCacheQuery($query, $params, $types, QueryCacheProfile $qcp)
    {
        $resultCache = $qcp->getResultCacheDriver() ?? $this->_config->getResultCacheImpl();

        if ($resultCache === null) {
            throw CacheException::noResultDriverConfigured();
        }

        $connectionParams = $this->getParams();
        unset($connectionParams['platform']);

        [$cacheKey, $realKey] = $qcp->generateCacheKeys($query, $params, $types, $connectionParams);

        // fetch the row pointers entry
        $data = $resultCache->fetch($cacheKey);

        if ($data !== false) {
            // is the real key part of this row pointers map or is the cache only pointing to other cache keys?
            if (isset($data[$realKey])) {
                $stmt = new ArrayStatement($data[$realKey]);
            } elseif (array_key_exists($realKey, $data)) {
                $stmt = new ArrayStatement([]);
            }
        }

        if (! isset($stmt)) {
            $stmt = new ResultCacheStatement($this->executeQuery($query, $params, $types), $resultCache, $cacheKey, $realKey, $qcp->getLifetime());
        }

        $stmt->setFetchMode($this->defaultFetchMode);

        return $stmt;
    }
public function executeCacheQuery ( $ query , $ params , $ types , QueryCacheProfile $ qcp ) { $ resultCache = $ qcp -> getResultCacheDriver ( ) ?? $ this -> _config -> getResultCacheImpl ( ) ; if ( $ resultCache === null ) { throw CacheException :: noResultDriverConfigured ( ) ; } $ connectionParams = $ this -> getParams ( ) ; unset ( $ connectionParams [ 'platform' ] ) ; [ $ cacheKey , $ realKey ] = $ qcp -> generateCacheKeys ( $ query , $ params , $ types , $ connectionParams ) ; // fetch the row pointers entry $ data = $ resultCache -> fetch ( $ cacheKey ) ; if ( $ data !== false ) { // is the real key part of this row pointers map or is the cache only pointing to other cache keys? if ( isset ( $ data [ $ realKey ] ) ) { $ stmt = new ArrayStatement ( $ data [ $ realKey ] ) ; } elseif ( array_key_exists ( $ realKey , $ data ) ) { $ stmt = new ArrayStatement ( [ ] ) ; } } if ( ! isset ( $ stmt ) ) { $ stmt = new ResultCacheStatement ( $ this -> executeQuery ( $ query , $ params , $ types ) , $ resultCache , $ cacheKey , $ realKey , $ qcp -> getLifetime ( ) ) ; } $ stmt -> setFetchMode ( $ this -> defaultFetchMode ) ; return $ stmt ; }
Executes a caching query.

@param string            $query  The SQL query to execute.
@param mixed[]           $params The parameters to bind to the query, if any.
@param int[]|string[]    $types  The types the previous parameters are in.
@param QueryCacheProfile $qcp    The query cache profile.

@return ResultStatement

@throws CacheException
Executes a caching query .