Using a string variable like $lvls = '8,9,10' in a query does not work correctly when passed in as a parameter. In the following query, the number of returned rows is incorrect, unless I replace the :levels variable with a hard-coded string.
$sql = "SELECT ... FROM ... WHERE ... AND el.ed_level_id IN (:levels)";
$model = new Content();
$data = $model->getReadConnection()->query($sql, ['levels' => '8,9,10'])->fetchAll();
Is this a bug in Phalcon, or what I'm doing? Replacing :levels with 8,9,10 in the query above results in a different number of rows retrieved.
As a side note, the reason I'm using this kind of query is based on performance. There are joins on six tables, some of which are very large. The same query using the query builder was at least ten times slower.