Hello!

Im been at this for hours and hanging in the IRC channel, without
getting the final solution.
I want to share events between users...

**I have these relations:
User hasmany Event
Event HABTM User

**I have these tables
[events]
-id
-user_id
-title

[users]
-id
-email
-and some other columns thats not interesting

[events_users]
-id
-event_id
-user_id
-group_id (not used at the moment)

When i perform
 $this->set('events', $this->Event->find('all'));

I get this result:
(this is $events)

Array (
[0] => Array ( [Event] => Array ( [id] => 9 [user_id] => 12 [title] =>
asdadggggg ) [User] => Array ( ) )
[1] => Array ( [Event] => Array ( [id] => 12 [user_id] => 28 [title]
=> Coooolllmaann ) [User] => Array ( ) )
[2] => Array ( [Event] => Array ( [id] => 23 [user_id] => 13 [title]
=> hehe, NOT SO FUNNY! )
        [User] => Array ( [0] => Array ( [id] => 12 [email] => aberg
[password] => 5b1fb8132b0dee40ed8aec0e0049fb005f612e55 [fname] =>
[ename] => [status] => 0
        [EventsUser] => Array ( [id] => 1 [event_id] => 23 [user_id] => 12
[group_id] => 0 ) ) ) )
[3] => Array ( [Event] => Array ( [id] => 26 [user_id] => 12 [title]
=> OBOYOYOYOYOY12 ) [User] => Array ( ) ) ) 1

-----
What i want to do with this array is that i want to collect those
Events that has user_id = 12. Which normally is 'id':9 and 26. Though
id 23 is shared to user_id 12. Therefore i want to collect it aswell!

I dont know how to do this and have been searching for hours...


Any help is greatly appreciated and i hope this can help others that
have the same problem.





--~--~---------~--~----~------------~-------~--~----~
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