Doctrine query () parameters?
I created Doctrine_Query and executed it, but I want to know what parameters I can pass to it.
$q = Doctrine_Query::create()
->select('cl.id, cl.name')
->from('ContactList cl');
$contactLists = $q->execute($params, $hydrationMode);
from api documentation:
execute($params = array(), $hydrationMode = null)
where will they tell me about the parameters? and also a hydration regimen.
it looks like I can't find anything in the docs. it would be great if they had a link to everything.
thanks
+2
a source to share
1 answer
I believe params is an array of values ββto bind to a query - similar to a predefined operator - like this:
$q = Doctrine_Query::create()
->select('cl.id, cl.name')
->from('ContactList cl')
->where('cl.name = ?');
$q->execute(array('fayer'));
The hydration mode is one of the hydration constants from Doctrine_Core
and determines how the result set is hydrated (array, object, etc.). You can also write custom hydrators if you need.
+2
a source to share