Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CWD
CwdDataDoctrineORMBundle
Commits
52864db8
Commit
52864db8
authored
Oct 04, 2018
by
Bernhard Schussek
Browse files
Added possibility to set the hydration mode during pagination
parent
b6faeaa0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Repository/ORMRepository.php
View file @
52864db8
...
...
@@ -579,8 +579,13 @@ abstract class ORMRepository extends EntityRepository implements EditableReposit
{
}
protected
function
fetchPage
(
QueryBuilder
$qb
,
string
$alias
,
PageRequest
$pageRequest
=
null
,
Order
$order
=
null
):
Page
{
protected
function
fetchPage
(
QueryBuilder
$qb
,
string
$alias
,
PageRequest
$pageRequest
=
null
,
Order
$order
=
null
,
$hydrationMode
=
Query
::
HYDRATE_OBJECT
):
Page
{
$countQb
=
clone
$qb
;
$totalCount
=
$countQb
->
select
(
sprintf
(
'COUNT(%s)'
,
$alias
))
...
...
@@ -595,7 +600,7 @@ abstract class ORMRepository extends EntityRepository implements EditableReposit
$this
->
addPaginationCriteria
(
$qb
,
$alias
,
$pageRequest
,
$order
);
}
$results
=
$qb
->
getQuery
()
->
execute
();
$results
=
$qb
->
getQuery
()
->
execute
(
null
,
$hydrationMode
);
if
(
$pageRequest
instanceof
BeforeOffset
)
{
// BeforeOffset is implemented as reverse AfterOffset search
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment