Bug #81887

make extbase pagination work with QueryBuilder

Added by Tymoteusz Motylewski over 2 years ago. Updated about 1 year ago.

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

100%

TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:
On Location Sprint

Description

Since 8.7 you can pass a QueryBuilder object as a parameter to the statement() method of the Extbase Query.

So inside repository method you can do sth like:


$queryBuilder->select('*')->...

$query = $this->createQuery();
$query->statement($queryBuilder);

return $query->execute();

The only missing thing is pagination support for queries built this way.

To achieve that we need 2 changes:
1)
in Typo3DbQueryParser::convertQueryToDoctrineQueryBuilder
we need to early return, as the QueryBuilder object is already available, so there is no need for a conversion.

2) in Typo3DbBackend::getObjectDataByQuery
set limit and offset to the query

Associated revisions

Revision a9f7ec32 (diff)
Added by Tymoteusz Motylewski about 2 years ago

[BUGFIX] Make Extbase pagination work with QueryBuilder queries

Now you can pass a query built by QueryBuilder to $query->statement(),
and use the QueryResult for pagination.

So inside repository you can create custom query like:

$queryBuilder->select('*')->...
$query = $this->createQuery();
$query->statement($queryBuilder);
return $query->execute();

and pass the result to paginate ViewHelper.

Resolves: #81887
Releases: master, 8.7
Change-Id: Ia00f673039362afaa8ef7232ba4bc89c520d5a46
Reviewed-on: https://review.typo3.org/53409
Reviewed-by: Anja Leichsenring <>
Tested-by: TYPO3com <>
Reviewed-by: Andreas Fernandez <>
Tested-by: Joerg Kummer <>
Reviewed-by: Stefan Neufeind <>
Reviewed-by: Wouter Wolters <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

Revision 3e6f22c1 (diff)
Added by Tymoteusz Motylewski about 2 years ago

[BUGFIX] Make Extbase pagination work with QueryBuilder queries

Now you can pass a query built by QueryBuilder to $query->statement(),
and use the QueryResult for pagination.

So inside repository you can create custom query like:

$queryBuilder->select('*')->...
$query = $this->createQuery();
$query->statement($queryBuilder);
return $query->execute();

and pass the result to paginate ViewHelper.

Resolves: #81887
Releases: master, 8.7
Change-Id: Ia00f673039362afaa8ef7232ba4bc89c520d5a46
Reviewed-on: https://review.typo3.org/54058
Tested-by: TYPO3com <>
Reviewed-by: Christian Kuhn <>
Tested-by: Christian Kuhn <>

History

#1 Updated by Gerrit Code Review over 2 years ago

  • Status changed from New to Under Review

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53409

#2 Updated by Gerrit Code Review over 2 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53409

#3 Updated by Gerrit Code Review over 2 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53409

#4 Updated by Gerrit Code Review about 2 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53409

#5 Updated by Gerrit Code Review about 2 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53409

#6 Updated by Gerrit Code Review about 2 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53409

#7 Updated by Gerrit Code Review about 2 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53409

#8 Updated by Gerrit Code Review about 2 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53409

#9 Updated by Gerrit Code Review about 2 years ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53409

#10 Updated by Tymoteusz Motylewski about 2 years ago

  • Sprint Focus set to On Location Sprint

#11 Updated by Gerrit Code Review about 2 years ago

Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/54058

#12 Updated by Tymoteusz Motylewski about 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#13 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF