Had an informative discussion on this at Stack Overflow:

http://stackoverflow.com/questions/936203/storing-sort-order-for-items-held-in-an-habtm-association-cakephp

On Jun 1, 9:31 pm, Hiero <v25me...@gmail.com> wrote:
> I have a HasAndBelongsToMany association setup on Videos and Bins: A
> Bin can store n references to Videos, and Videos can belong to n Bins.
>
> I need to be able to manually set and store the display order of the
> Videos within a particular Bin (so the client can have his Videos in a
> particular order within the Bin.) My initial thought is to create a
> field in Bin that stores an array of Video IDs in the order they need
> to appear. Is this the most efficient way to handle this?
>
> If so, when I then get the HABTM query result, what is the cleanest/
> most efficient way to re-order the returned query to match the sorted
> array of ID's?
>
> Or is there a better way to achieve what I'm trying to do without
> using HABTM associations?
>
> Thanks in advance -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to