It can be done easily with a HABTM relationship. For example, 

Table Users:
  - id
  - name
  - email

Table Followers
  - id
  - name
  - email

and then to create the HABTM relationship, all you have to do is create an 
association table to join Users and Followed_Users.

Table Followed_Users
  - id
  - user_id
  - follower_id

and make them both UNIQUE KEY ` user_id ` (` user_id `,` follower_id `). 
This should do the trick. You don't have to worry about the relationships 
when deleting a record, Cake already takes care of it by setting 
the 'unique' => 'keepExisting' in the association of the Model.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to