Not sure where to start with this one, so offering it up for advice.
I have 2 associated models...
* Members
* Events
* Roles
The Roles table links the members to events.
What I would like to do is include the number of events a member has
been involved with by including the Event count in the Members list
(index) view, but would also like to be able to use the Paginator's
magic to be able to sort by the number of events a member has been
involved with.
The models are setup as...
Member hasMany Roles
Event hasMany Roles
Can anyone offer any advice on how to do this?
To make it a little more complicated some Members may perform multiple
roles at 1 event, but I am interested in the number of unique Events
for a Member, not the number of Roles they have performed.
If it wasn't for the pagination, I could easily do this by traversing
the results & extracting unique events, but I would like to be able to
sort the results.
Thanks for any help you can offer.
T
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment