public function execute()
    {
        static $apcPrefix = null;
        if($apcPrefix === null) {
            $apcPrefix = function_exists('apcu_fetch') ? 'apcu' : 'apc';
        }

        // Generate a cache key by comparing our parameters to see if we've
        // made this query before
        $key = $this->getParameterHash() . $this->getFileHash();

        // Try and fetch a cached result object from APC
        $funcName = $apcPrefix . '_fetch';
        $success  = false;
        $result   = $funcName($key, $success);

        // If the result isn't in the cache then we run the real query
        if (!$success) {
            $result = parent::execute();
            $funcName = $apcPrefix . '_store';
            $funcName($key, $result);
        }

        return $result;
    }
public function execute()
    {
        static $apcPrefix = null;
        if($apcPrefix === null) {
            $apcPrefix = function_exists('apcu_fetch') ? 'apcu' : 'apc';
        }

        // Generate a cache key by comparing our parameters to see if we've
        // made this query before
        $key = $this->getParameterHash() . $this->getFileHash();

        // Try and fetch a cached result object from APC
        $funcName = $apcPrefix . '_fetch';
        $success  = false;
        $result   = $funcName($key, $success);

        // If the result isn't in the cache then we run the real query
        if (!$success) {
            $result = parent::execute();
            $funcName = $apcPrefix . '_store';
            $funcName($key, $result);
        }

        return $result;
    }
public function execute ( ) { static $ apcPrefix = null ; if ( $ apcPrefix === null ) { $ apcPrefix = function_exists ( 'apcu_fetch' ) ? 'apcu' : 'apc' ; } // Generate a cache key by comparing our parameters to see if we've // made this query before $ key = $ this -> getParameterHash ( ) . $ this -> getFileHash ( ) ; // Try and fetch a cached result object from APC $ funcName = $ apcPrefix . '_fetch' ; $ success = false ; $ result = $ funcName ( $ key , $ success ) ; // If the result isn't in the cache then we run the real query if ( ! $ success ) { $ result = parent :: execute ( ) ; $ funcName = $ apcPrefix . '_store' ; $ funcName ( $ key , $ result ) ; } return $ result ; }
Checks the cache to see if this query exists and returns it. If it's
not in the cache then the query is run, stored and then returned.

@return Result The result of the query.
Checks the cache to see if this query exists and returns it . If it s not in the cache then the query is run stored and then returned .