Project

General

Profile

Actions

Bug #81822

closed

Allow to clone QueryBuilder

Added by Tymoteusz Motylewski over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2017-07-08
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The Doctrine query builder supports cloning, so should our Query Builder, which is just a wrapper around it.

$newQueryBuilder = clone $queryBuilder;

Cloning of the query builder is useful when e.g. implementing pagination where process looks usually like:

- User provides query builder without limit and page
- pagination takes the query builder, clones it, changes the select part to "count(*)" to get the count of the results
- pagination takes the original query builder adds a limit and offset, and executes the query

Actions

Also available in: Atom PDF