Bug #29271

Query setOrdering doesn't work on relations

Added by Torsten no-lastname-given over 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Persistence
Target version:
-
Start date:
2011-08-26
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

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;
    }

#1

Updated by Ferdinand Kuhl over 10 years ago

This is a duplicate of:

http://forge.typo3.org/issues/26885

#3

Updated by Johannes K almost 10 years ago

And can get closed now, #26885 is resolved

#4

Updated by Christian Müller over 9 years ago

  • Status changed from New to Closed
  • Has patch set to No

Also available in: Atom PDF