Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Orm
related models
spescina
November 2012
Hi all.
I'm wondering if it's possible to perform simple operations like a order by or a custom field select
on a related model query.
something like this...
Model_My::find('all',array(
'related' => array('related_model'),
'select' => array(
'this_model_field',
'related_model_field
),
'order_by' => array(
'related_model_field',
'asc'
));
Thanks.
Harro
November 2012
Yes, you can.
FuelPHP uses 'dot-notation' to identify subelements, you would identify the 'field' table in the 'related_model' object using
'related_model.field'.
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,088
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
260
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
November 2012