public function findAll($hydrationMode = null)
{
- return $this->createQuery()->execute(array(), $hydrationMode);
+ $q = $this->createQuery();
+ if ($this->_ordering)
+ $q->orderBy(implode(', ', $this->_ordering));
+ return $q->execute(array(), $hydrationMode);
}
public function findBySql($dql, $params = array(), $hydrationMode = null)
protected function findBy($fieldName, $value, $hydrationMode = null)
{
- return $this->createQuery()->where($fieldName . ' = ?', array($value))->execute(array(), $hydrationMode);
+ $q = $this->createQuery()->where($fieldName . ' = ?', array($value));
+ if ($this->_ordering)
+ $q->orderBy(implode(', ', $this->_ordering));
+ return $q->execute(array(), $hydrationMode);
}
protected function findOneBy($fieldName, $value, $hydrationMode = null)