phalcon/cphalcon — pull request #2990 by quantum13 (2014-11-07 08:31:34+00:00)
Title: [2.0.0] Binding arrays

Related #2934

Port of Doctrine DBAL SQLParserUtils

Usage:

$songs = $connection->fetchAll(
'select * from songs where name in (?) order by id',
Db::FETCH_ASSOC,
array(array('Born to Die', 'Off to Races', 'Blue Jeans'))
);

$connection->delete(
'songs',
'name in (?)',
array(array('name1','name2'))
);

$persons = Robots::find(array(
"id in (:ids:)",
'bind' => array('ids' => array(1, 2, 3)),
'bindTypes' => array('ids' => Column::BIND_PARAM_INT_ARRAY)
));

$persons = Robots::find(array(
"id in (?0)",
'bind' => array(array(1, 2, 3))
));

Original class is under MIT licence. In which form I must write copyright notices in ported files?
Now I write default template for such files:
https://github.com/quantum13/cphalcon/blob/bind_array/phalcon/db/utils/sqlparser.zep
https://github.com/quantum13/cphalcon/blob/bind_array/tests/unit/Phalcon/Db/Utils/SQLParserTest.php