tags:

views:

66

answers:

1

I was wondering if it is possible to bind an array of integers as a parameter, so I could do something like this?

$q = Doctrine_Query::create()
                    ->update('blah c')
                    ->set('ignored', true)
                    ->where('id in ?', array(1,2,3,4));

I guess that this isn't possible because it actually binds the variables using the database/PDO, which wouldn't support it.

Apologies if I have missed this in the documentation or another question. Thanks.

+2  A: 

use like :

 ->whereIn('id', array(1, 3, 4, 5));

more :

http://www.doctrine-project.org/documentation/manual/1_2/en/dql-doctrine-query-language

Haim Evgi
great thanks. i did miss that in the documentation..
Tom Haigh
glad to hear , I'd be happy if you accept my answer
Haim Evgi
@Haim Evgi: have done, sorry, it made me wait 6 minutes and then i forgot for a bit
Tom Haigh
@tom : Heartfelt thanks
Haim Evgi