Bug #6786

Persistence Query Orderings integers ordered like strings

Added by Georg Ortner over 11 years ago. Updated almost 11 years ago.

Status:
Resolved
Priority:
Must have
Category:
Persistence
Start date:
2010-03-16
Due date:
% Done:

100%

Estimated time:
2.00 h
PHP Version:
Has patch:
Complexity:

Description

Code (property order is declared as INT):

$query->matching( $query->equals('parentUUID', ''))
    ->setOrderings(array('order' => \F3\FLOW3\Persistence\QueryInterface::ORDER_ASCENDING))

The result is:

1
10
12
17
2
29
3

If order was a string this would be fine but for an integer everyone would expect:

1
2
3
10
12
17
29

Also available in: Atom PDF