Issue Feature Closed

#33345Query orderings can't use custom expressions

Tobias Liebig 01/20/12, 23:27 updated 03/19/20, 16:00

Description

Currently Tx_Extbase_Persistence_Query->setOrderings does only support ASC and DESC orderings.

One might want to pass a custom expression as ordering. E.g. if you want to get your objects in a predefined order:

$query = $this->createQuery(); $query->setOrderings(array( 'FIELD (uid, ' . implode(', ', $uidList) .')' => Tx_Extbase_Persistence_QueryInterface::ORDER_FIELD )); return $query ->matching($query->in('uid', $uidList)) ->execute();

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.