Tuesday, November 23, 2010

RE: cakephp Messaging sysytem

I've been doing some reading on how to set up the tables as I would want
each message to go to multiple users if the sender so desires. I found this
on stackoverflow. Anyone out there done something similar that can look at
this schema and provide input?

messages table

id
timestamp
sender_id
subject
message
due_date
urgent_flag
open_flag
reply_id

message_user (table)

id
timestamp
message_id
receiver_id
read_flag

The CakePHP relations are as follows :

Message Model

var $hasMany = array(
'MessageUser' => array(
'className' => 'MessageUser',
'foreignKey' => 'message_id',
)
);
var $belongsTo = array (
'User' => array (
'className' => 'User',
'foreignKey' => 'sender_id',
)
);
var $hasAndBelongsTo=array(
'Message' => array (
'className' => 'Message',
'foreignKey' => 'reply_id',
)
);

MessageUser Model

var $belongsTo = array (
'User' => array (
'className' => 'User',
'foreignKey' => 'receiver_id',
),
'Message' => array (
'className' => 'Message',
'foreignKey' => 'message_id'

)
);

-----Original Message-----
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of pave2009
Sent: Tuesday, November 23, 2010 10:32 AM
To: CakePHP
Subject: Re: cakephp Messaging sysytem

Sounds like a great idea..Please let me know how we can proceed
further..?
Yes it would be helpful to others also.


On Nov 23, 12:30 am, "whmeroe" <whme...@gmail.com> wrote:
> I've been looking as well but have not come up with something yet.  I
> suspect we should design one and release it as a plugin as from what I've
> been reading a lot of people are looking for one.
>
> -----Original Message-----
> From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On
Behalf
>
> Of pave2009
> Sent: Monday, November 22, 2010 12:27 PM
> To: CakePHP
> Subject: cakephp Messaging sysytem
>
> Hi All,
>
> I am working on  a dating site where i need to implement a feature
> where registered user can send message to each other, just wanted to
> know do we have any component/plugin already available for messaging.
>
> Thanks,
> Pave
>
> Check out the new CakePHP Questions sitehttp://cakeqs.organd 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
athttp://groups.google.com/group/cake-php?hl=en

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

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: