I\'m using the PHP Doctrine ORM to build my queries. However, I can\'t quite seem to figure how to write the following WHERE clause using DQL (Doctrine Query Language):
andWhere can be summarized as:
Previously Added Condition(s) Aware WHERE Statement
You can safely use andWhere inplace of where. (it introduces a very tiny overhead, which is stated below in the 2nd list item.)
The implementation of andWhere is: (Doctrine 1.2.3)
public function andWhere($where, $params = array())
{
if (is_array($params)) {
$this->_params['where'] = array_merge($this->_params['where'], $params);
} else {
$this->_params['where'][] = $params;
}
if ($this->_hasDqlQueryPart('where')) {
$this->_addDqlQueryPart('where', 'AND', true);
}
return $this->_addDqlQueryPart('where', $where, true);
}
which can be read as,