public function rewind()
    {
        if ($this->cacheEntriesIterator !== null) {
            $this->cacheEntriesIterator->rewind();
            return;
        }

        $cacheEntries = [];

        $statementHandle = $this->databaseHandle->prepare('SELECT "identifier", "content" FROM "' . $this->cacheTableName . '" WHERE "context"=? AND "cache"=?' . $this->getNotExpiredStatement());
        $statementHandle->execute([$this->context(), $this->cacheIdentifier]);
        $fetchedColumns = $statementHandle->fetchAll();

        foreach ($fetchedColumns as $fetchedColumn) {
            // Convert hexadecimal data into binary string,
            // because it is not allowed to store null bytes in PostgreSQL.
            if ($this->pdoDriver === 'pgsql') {
                $fetchedColumn['content'] = hex2bin($fetchedColumn['content']);
            }

            $cacheEntries[$fetchedColumn['identifier']] = $fetchedColumn['content'];
        }

        $this->cacheEntriesIterator = new \ArrayIterator($cacheEntries);
    }
public function rewind()
    {
        if ($this->cacheEntriesIterator !== null) {
            $this->cacheEntriesIterator->rewind();
            return;
        }

        $cacheEntries = [];

        $statementHandle = $this->databaseHandle->prepare('SELECT "identifier", "content" FROM "' . $this->cacheTableName . '" WHERE "context"=? AND "cache"=?' . $this->getNotExpiredStatement());
        $statementHandle->execute([$this->context(), $this->cacheIdentifier]);
        $fetchedColumns = $statementHandle->fetchAll();

        foreach ($fetchedColumns as $fetchedColumn) {
            // Convert hexadecimal data into binary string,
            // because it is not allowed to store null bytes in PostgreSQL.
            if ($this->pdoDriver === 'pgsql') {
                $fetchedColumn['content'] = hex2bin($fetchedColumn['content']);
            }

            $cacheEntries[$fetchedColumn['identifier']] = $fetchedColumn['content'];
        }

        $this->cacheEntriesIterator = new \ArrayIterator($cacheEntries);
    }
public function rewind ( ) { if ( $ this -> cacheEntriesIterator !== null ) { $ this -> cacheEntriesIterator -> rewind ( ) ; return ; } $ cacheEntries = [ ] ; $ statementHandle = $ this -> databaseHandle -> prepare ( 'SELECT "identifier", "content" FROM "' . $ this -> cacheTableName . '" WHERE "context"=? AND "cache"=?' . $ this -> getNotExpiredStatement ( ) ) ; $ statementHandle -> execute ( [ $ this -> context ( ) , $ this -> cacheIdentifier ] ) ; $ fetchedColumns = $ statementHandle -> fetchAll ( ) ; foreach ( $ fetchedColumns as $ fetchedColumn ) { // Convert hexadecimal data into binary string, // because it is not allowed to store null bytes in PostgreSQL. if ( $ this -> pdoDriver === 'pgsql' ) { $ fetchedColumn [ 'content' ] = hex2bin ( $ fetchedColumn [ 'content' ] ) ; } $ cacheEntries [ $ fetchedColumn [ 'identifier' ] ] = $ fetchedColumn [ 'content' ] ; } $ this -> cacheEntriesIterator = new \ ArrayIterator ( $ cacheEntries ) ; }
Rewinds the cache entry iterator to the first element
and fetches cacheEntries.

@return void
@api
Rewinds the cache entry iterator to the first element and fetches cacheEntries .