@@ -41,19 +41,6 @@ public function findByOptions($options = array()) {
41
41
42
42
$ qb = $ this ->createQueryBuilder ('a ' )
43
43
->join ('DataDog\AuditBundle\Entity\Association ' , 'aa ' , 'WITH ' , 'aa = a.source ' );
44
-
45
- // Totals Count
46
- $ totalLogsQb = clone $ qb ;
47
- $ totalLogsQb ->select ('COUNT(a.id) ' );
48
- $ totalCountQuery = $ totalLogsQb ->getQuery ();
49
-
50
- try {
51
- $ totalLogsCount = $ totalCountQuery ->getSingleScalarResult ();
52
- } catch (NoResultException $ e ) {
53
- $ totalLogsCount = 0 ;
54
- } catch (NonUniqueResultException $ e ) {
55
- $ totalLogsCount = 0 ;
56
- }
57
44
58
45
// Apply filters
59
46
foreach ($ options ["filters " ] as $ field => $ search ) {
@@ -130,18 +117,6 @@ public function findByOptions($options = array()) {
130
117
$ qb ->orderBy ($ options ["sortBy " ], $ options ["orderBy " ]);
131
118
}
132
119
133
- $ countQb = clone $ qb ;
134
- $ countQb ->select ('COUNT(a.id) ' );
135
- $ countQuery = $ countQb ->getQuery ();
136
-
137
- try {
138
- $ logsCount = $ countQuery ->getSingleScalarResult ();
139
- } catch (NoResultException $ e ) {
140
- $ logsCount = 0 ;
141
- } catch (NonUniqueResultException $ e ) {
142
- $ logsCount = 0 ;
143
- }
144
-
145
120
$ resultQuery = $ qb ->getQuery ();
146
121
if (isset ($ options ["_paginate " ]) && $ options ["_paginate " ] == true ) {
147
122
if (null !== $ options ["limit " ])
@@ -154,12 +129,7 @@ public function findByOptions($options = array()) {
154
129
155
130
return array (
156
131
"draw " => intval ( $ options ["draw " ] ),
157
- "recordsTotal " => $ totalLogsCount ,
158
- "recordsFiltered " => $ logsCount ,
159
132
'data ' => $ logs ,
160
- "pagination " => array (
161
- "more " => $ logsCount > ($ options ["start " ] + $ options ["limit " ]),
162
- )
163
133
);
164
134
165
135
}
0 commit comments