Maybe you can use this :
$this-Message-User-find('all', 'conditions' = array('User.id' =
$this-Auth-user('id') ) );
Assuming you're using Auth component..
Okto.Silaban.Net
On Tue, Sep 23, 2008 at 9:26 PM, iGloo [EMAIL PROTECTED] wrote:
Hi folks,
I've looked around a lot but could'nt find an answer or example to
what i am trying to do.
I'm trying to create a message center where a user sends message to
either 1 user or a group of user.
so:
User hasMany messages
messages hasAndBelongsToMany User
This would create the following tables:
user - id, name
message - id, from_user_id, title, content
messages_users - user_id, message_id
I can add messages to the system without any problems.
The problem is how do i only fetch messages destinated to the
currently logged user ? (user id available via session data).
Is there another way to do this?
Further down the road, a message will have to be sent to a group,
where a user hasManyAndBelongsTo group, but for now i'm focusing on
the base functionnalities.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---