Project

General

Profile

Actions

Feature #33345

closed

Query orderings can't use custom expressions

Added by Tobias Liebig over 12 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2012-01-20
Due date:
% Done:

90%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

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();
Actions

Also available in: Atom PDF