Iterate objects in a determinate order ?

33 views
Skip to first unread message

Jesús Rubio Hidalgo

unread,
Jul 15, 2022, 2:44:55 AM7/15/22
to Fat-Free Framework
Hi. 

I want to ask a question I dont know if is possible or not. 

I have configure a relationship with $fieldConf in my class With this, I can iterate the object like this

foreach ($item->objects as $object) {
     // do the stuff
}

So, it is possible order, for example, by a field named date, like the find function or someone like that?

Thank you

                   

Paul Herring

unread,
Jul 15, 2022, 4:21:15 AM7/15/22
to Jesús Rubio Hidalgo a través de Fat-Free Framework
Second (array) parameter to find().

$objs = $mapper->find(null, ['order' => 'date DESC']);


--
-- You've received this message because you are subscribed to the Google Groups group. To post to this group, send an email to f3-fra...@googlegroups.com. To unsubscribe from this group, send an email to f3-framework...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/f3-framework?hl=en
---
You received this message because you are subscribed to the Google Groups "Fat-Free Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to f3-framework...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/f3-framework/2d523b8c-bd9c-41d2-b554-27f28406f938n%40googlegroups.com.


--
PJH

Reply all
Reply to author
Forward
0 new messages