29
29
namespace MetaModels \AttributeSelectBundle \Attribute ;
30
30
31
31
use Doctrine \DBAL \Connection ;
32
- use Doctrine \DBAL \Statement ;
32
+ use Doctrine \DBAL \Driver \ Statement ;
33
33
34
34
/**
35
35
* This is the MetaModelAttribute class for handling select attributes on plain SQL tables.
36
- *
37
- * @package MetaModels
38
- * @subpackage AttributeSelect
39
- * @author Christian Schiffler <[email protected] >
40
- * @author Christian de la Haye <[email protected] >
41
36
*/
42
37
class Select extends AbstractSelect
43
38
{
@@ -176,8 +171,9 @@ public function getFilterOptionsForUsedOnly($usedOnly)
176
171
{
177
172
$ additionalWhere = $ this ->getAdditionalWhere ();
178
173
$ sortColumn = $ this ->getSortingColumn ();
174
+
179
175
if ($ usedOnly ) {
180
- $ this ->connection ->query (sprintf (
176
+ return $ this ->connection ->query (sprintf (
181
177
'SELECT COUNT(%1$s.%2$s) as mm_count, %1$s.*
182
178
FROM %1$s
183
179
RIGHT JOIN %3$s ON (%3$s.%4$s=%1$s.%2$s)
@@ -195,7 +191,7 @@ public function getFilterOptionsForUsedOnly($usedOnly)
195
191
));
196
192
}
197
193
198
- return $ this ->connection ->execute (sprintf (
194
+ return $ this ->connection ->query (sprintf (
199
195
'SELECT COUNT(%3$s.%4$s) as mm_count, %1$s.*
200
196
FROM %1$s
201
197
LEFT JOIN %3$s ON (%3$s.%4$s=%1$s.%2$s)
@@ -280,14 +276,13 @@ public function getDataFor($arrIds)
280
276
'SELECT sourceTable.*, %2$s.id AS %3$s
281
277
FROM %1$s sourceTable
282
278
LEFT JOIN %2$s ON (sourceTable.%4$s=%2$s.%5$s)
283
- WHERE %2$s.id IN (%6$s ) ' ,
279
+ WHERE %2$s.id IN (:ids ) ' ,
284
280
// @codingStandardsIgnoreStart - We want to keep the numbers as comment at the end of the following lines.
285
281
$ strTableNameId , // 1
286
282
$ strMetaModelTableName , // 2
287
283
$ strMetaModelTableNameId , // 3
288
284
$ strColNameId , // 4
289
- $ this ->getColName (), // 5
290
- $ this ->parameterMask ($ arrIds ) // 6
285
+ $ this ->getColName () // 5
291
286
// @codingStandardsIgnoreEnd
292
287
)
293
288
);
0 commit comments