File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
lib/internal/Magento/Framework/Search/Adapter/Mysql Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 7
7
8
8
use Magento \Framework \App \ResourceConnection ;
9
9
use Magento \Framework \DB \Ddl \Table ;
10
+ use Magento \Framework \DB \Select ;
10
11
use Magento \Framework \Search \Adapter \Mysql \Aggregation \Builder as AggregationBuilder ;
11
12
use Magento \Framework \Search \AdapterInterface ;
12
13
use Magento \Framework \Search \RequestInterface ;
@@ -129,32 +130,35 @@ private function getConnection()
129
130
/**
130
131
* Get rows size
131
132
*
133
+ * @param Select $query
132
134
* @return int
133
135
*/
134
- private function getSize ($ query )
136
+ private function getSize (Select $ query ): int
135
137
{
136
138
$ sql = $ this ->getSelectCountSql ($ query );
137
139
$ parentSelect = $ this ->getConnection ()->select ();
138
140
$ parentSelect ->from (['core_select ' => $ sql ]);
139
141
$ parentSelect ->reset (\Magento \Framework \DB \Select::COLUMNS );
140
142
$ parentSelect ->columns ('COUNT(*) ' );
141
143
$ totalRecords = $ this ->getConnection ()->fetchOne ($ parentSelect );
144
+
142
145
return intval ($ totalRecords );
143
146
}
144
147
145
148
/**
146
149
* Reset limit and offset
147
150
*
151
+ * @param Select $query
148
152
* @return Select
149
153
*/
150
- private function getSelectCountSql ($ query )
154
+ private function getSelectCountSql (Select $ query ): Select
151
155
{
152
156
foreach ($ this ->countSqlSkipParts as $ part => $ toSkip ) {
153
157
if ($ toSkip ) {
154
158
$ query ->reset ($ part );
155
159
}
156
160
}
161
+
157
162
return $ query ;
158
163
}
159
-
160
164
}
You can’t perform that action at this time.
0 commit comments