Bug #29271
Query setOrdering doesn't work on relations
Status: | Closed | Start date: | 2011-08-26 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | - | % Done: | 0% |
|
Category: | Persistence | |||
Target version: | - | |||
PHP Version: | Complexity: | |||
Has patch: | No | Affected Flow version: | FLOW3 1.0.0 |
Description
TYPO3\FLOW3\Persistence\Doctrine\Query->setOrdering does not work on related fields:
Currently:
public function setOrderings(array $orderings) { $this->orderings = $orderings; $this->queryBuilder->resetDQLPart('orderBy'); foreach ($this->orderings AS $propertyName => $order) { $this->queryBuilder->addOrderBy($this->queryBuilder->getRootAlias() . '.' . $propertyName, $order); } return $this; }
Better:
public function setOrderings(array $orderings) { $this->orderings = $orderings; $this->queryBuilder->resetDQLPart('orderBy'); foreach ($this->orderings AS $propertyName => $order) { $this->queryBuilder->addOrderBy($this->getPropertyNameWithAlias($propertyName), $order); } return $this; }
History
#1 Updated by Ferdinand Kuhl almost 4 years ago
This is a duplicate of:
#2 Updated by Karsten Dambekalns almost 4 years ago
- Affected Flow version set to FLOW3 1.0.0
#3 Updated by Johannes K over 3 years ago
And can get closed now, #26885 is resolved
#4 Updated by Christian Müller over 3 years ago
- Status changed from New to Closed
- Has patch set to No