Merge branch 'DDC-968'
This commit is contained in:
commit
be2e00c991
@ -458,6 +458,16 @@ abstract class AbstractQuery
|
|||||||
return isset($this->_hints[$name]) ? $this->_hints[$name] : false;
|
return isset($this->_hints[$name]) ? $this->_hints[$name] : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the key value map of query hints that are currently set.
|
||||||
|
*
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getHints()
|
||||||
|
{
|
||||||
|
return $this->_hints;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes the query and returns an IterableResult that can be used to incrementally
|
* Executes the query and returns an IterableResult that can be used to incrementally
|
||||||
* iterate over the result.
|
* iterate over the result.
|
||||||
|
@ -86,4 +86,17 @@ class QueryTest extends \Doctrine\Tests\OrmTestCase
|
|||||||
|
|
||||||
$this->assertSame($q2, $q);
|
$this->assertSame($q2, $q);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @group DDC-968
|
||||||
|
*/
|
||||||
|
public function testHints()
|
||||||
|
{
|
||||||
|
$q = $this->_em->createQuery("select a from Doctrine\Tests\Models\CMS\CmsArticle a");
|
||||||
|
$q->setHint('foo', 'bar')->setHint('bar', 'baz');
|
||||||
|
|
||||||
|
$this->assertEquals('bar', $q->getHint('foo'));
|
||||||
|
$this->assertEquals('baz', $q->getHint('bar'));
|
||||||
|
$this->assertEquals(array('foo' => 'bar', 'bar' => 'baz'), $q->getHints());
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user