4

I am new to fuelphp.Need to add order_by for parent table: order by username asc, parent_table_field asc. I tried following code:

Model_Definition::find('all',
Array
(
[related] => Array
    (
        [users] => Array
            (
                [order_by] => Array
                    (
                        [username] => asc
                    )

            )

    )
 [order_by] => Array
 (
     [parent_table_field] => asc
 )
[rows_limit] => 50
[rows_offset] => 0
)
)

But it applies order by for parent-table's field first and then for username.

KingCrunch
  • 128,817
  • 21
  • 151
  • 173
Jaya Vishwakarma
  • 1,332
  • 1
  • 18
  • 36

1 Answers1

0

You can not control the way the query is generated using array notation.

You'll have more control with method chaining, which will apply the order_by clauses in the sequence in which they are defined.

WanWizard
  • 2,574
  • 15
  • 13