php - Proper way of doing a Twitter-like follower and retweets system on CakePHP 2? -


I'm super new for CakePHP. I've searched everywhere for this but I think it's ok to get it right. Unable to enable or search for orientation of some kind. I still do not get the full HABT thing working and I'm hoping to know more about it.

I am trying to do a Twitter-like system, with users and followers, and post (s) and shares (retweets). I've posted sets and models to users, and can join tables for followers (between users and users) and shares (among users and posts). How should I set up my model associations? I am trying in many ways but I am not sure whether I am doing right or not.

And the other question is, the people I have followed, will be the appropriate search query to receive all the posts posted by them, and without obtaining all unnecessary data like user information, Only posts in an array? Is it possible to find it in a query, or should I do so and then the arrays should be merged? Also, it would be very useful to understand how to properly filter and sort such complex queries (getting "post timeline" between some date ranges, limiting the post to a certain amount, or both) .

I know that my question is a bit stupid, but I have vowed that I have done a lot of research and I can not be able to get it properly. Therefore any help, especially with the query part, will be greatly appreciated.

Thank you!

So these are some strange relationships I think you should have the following applause:

  • There are too many tweets in the user (with the alias followers)
  • are members of posts
  • User-authorized (an HABT table)

    To make this work only on three tables, mail should be a threaded table. In short, if someone posts a post (share) A new record new positions with the ID of the original parent_id has been made in the column, then the model can pull additional data when the record was called and it is to be added to feed.

    The nickname aspect of the user can be done in just a table for the follower part. To find a follower of a person, search with a key ( follower_id ) of the table and search for people to find that someone searches from another key ( users_id ) .

    For the second part of your question, it should be very easy to find in this setup, but you may want to read. You can include timestamp columns in the tables so that you can search based on the latter feature (or post timeline).

Comments

Popular posts from this blog

java - NullPointerException for a 2d Array -

python - Assemble mpeg file unable to play in mediaplayer -

c# - NameSpace Manager or XsltContent to parse aspx page -