Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
related models
  • 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.
  • 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'.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion