Multiple sort conditions

2 views
Skip to first unread message

daniel79

unread,
Apr 23, 2008, 6:47:21 AM4/23/08
to Php Object Generator
Hi,

first of all thanks a lot for POG! It's an amazing time-saver!

I have one wish for the next Version:

$myObj->GetList();

should take an array for $sortBy... like:

$myObj->GetList(null, array('sort' => true, 'objid' => false));

where true/false means ascending and descending.

Or is this a larger problem?

Keep up the great work!
Daniel

andy law (RI)

unread,
Apr 23, 2008, 10:32:30 AM4/23/08
to Php-Object...@googlegroups.com
You can hack this with a bit of a 'sql injection' (so be very careful if
you allow your users to enter details of sort orders).

If you want to order on 'sort' (ascending) and 'objid' (descending) as
in your example you can specify "sort asc, objid" as the value for $sort
and false for $ascending.

I feel dirty every time I do that though :o}

Later,

Andy

-------------
Yada, yada, yada...

Roslin Institute is a company limited by guarantee, registered in
Scotland (registered number SC157100) and a Scottish Charity (registered
number SC023592). Our registered office is at Roslin, Midlothian, EH25
9PS. VAT registration number 847380013.

The information contained in this e-mail (including any attachments) is
confidential and is intended for the use of the addressee only. The
opinions expressed within this e-mail (including any attachments) are
the opinions of the sender and do not necessarily constitute those of
Roslin Institute (Edinburgh) ("the Institute") unless specifically
stated by a sender who is duly authorised to do so on behalf of the
Institute.

andy law (RI)

unread,
Apr 23, 2008, 10:47:35 AM4/23/08
to Php-Object...@googlegroups.com
And another thing....

If it were implemented, it would need to be an array of arrays (I think)
so that the order of the elements could be guaranteed?

Reply all
Reply to author
Forward
0 new messages