commit
8a52e3033b
@ -229,9 +229,9 @@ abstract class AbstractQuery
|
||||
{
|
||||
switch (true) {
|
||||
case is_array($value):
|
||||
for ($i = 0, $l = count($value); $i < $l; $i++) {
|
||||
$paramValue = $this->processParameterValue($value[$i]);
|
||||
$value[$i] = is_array($paramValue) ? $paramValue[key($paramValue)] : $paramValue;
|
||||
foreach ($value as $key => $paramValue) {
|
||||
$paramValue = $this->processParameterValue($paramValue);
|
||||
$value[$key] = is_array($paramValue) ? $paramValue[key($paramValue)] : $paramValue;
|
||||
}
|
||||
|
||||
return $value;
|
||||
|
@ -125,4 +125,25 @@ class QueryTest extends \Doctrine\Tests\OrmTestCase
|
||||
$q = $this->_em->createQuery("SELECT DISTINCT u from Doctrine\Tests\Models\CMS\CmsUser u LEFT JOIN u.articles a");
|
||||
$q->iterate();
|
||||
}
|
||||
|
||||
/**
|
||||
* @group DDC-1697
|
||||
*/
|
||||
public function testKeyValueParameters()
|
||||
{
|
||||
$cities = array(
|
||||
0 => "Paris",
|
||||
3 => "Canne",
|
||||
9 => "St Julien"
|
||||
);
|
||||
|
||||
$query = $this->_em
|
||||
->createQuery("SELECT a FROM Doctrine\Tests\Models\CMS\CmsAddress a WHERE a.city IN (:cities)")
|
||||
->setParameter('cities', $cities);
|
||||
|
||||
$parameters = $query->getParameters();
|
||||
|
||||
$this->assertArrayHasKey('cities', $parameters);
|
||||
$this->assertEquals($cities, $parameters['cities']);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user