Cakephp paginator sort method with a habtm relation question -


Here's an example ...

I use the table to manage all my situations I am doing the tree's behavior. I have a book model in which there is a situation for its condition and one for its availability, so the book model was also thought about HABT status that there may be only one condition and one availability in it.

Is there a way to use $ paginator-> sort ('condition', '?') With HABTM? I would like to sort the title from the array below.

It is that this $ -> data is giving me:

  [status] = & gt; Array ([0] = & gt; Array ([ID] => 2 [parent_id] => [[LFT] => 2 [rght] => 3 [Title] = & gt; Mint [built] => 2010-01-18 16:20:54 [modified] => 2010-01-18 16:20:54 [active] => 1 [boxstats] => Array ([id] = & gt; 7 [Book_id] => 3 [status_id] => 2)))  

i will use 2x with different names.

$ correlate = array ('BookStatus' =>; array (' className '= & gt;' position ',' foreign key '=>' book_status_id '),' bookcondition '= & Gt; array (' classname '= & gt;' position ',' foreigner '=> gtcondition_id' '))

Do not know how this can interfere with your tree

If it does not work, try $ paginator-> sort ('Condition', 'BooksStatus.status_id'); You will need to make sure to include the query used to retrieve the above (unind / bind to flight)


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -