Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8499683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:44:02+00:00 2026-06-11T00:44:02+00:00

I am trying to setup a self join and having hell. For example, a

  • 0

I am trying to setup a self join and having hell.

For example, a User has a ContactList, which is just other Users. So ContactList is a join table connecting User to itself.

User

id | name

ContactList

id | user_id | friend_id

After baking however, im not getting the result i expect. I’ve googled solutions but they dont work for me. How is this kind of situation handled? Do i need to customize the model?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:44:03+00:00Added an answer on June 11, 2026 at 12:44 am

    The solution is to set up your associations manually, per the CakePHP book [Associations].

    How can CakePHP know what you’re referring to with “friend_id” if there’s no “friends” table? Hint: it can’t.

    There are plenty of great examples in the book on the page about Associations (the link above). Read through it and you’ll most definitely have a better understanding.

    It’s not really considering “customizing the model” by doing things that aren’t baked for you. Baking is just a quick way to get the bare-bones up and rolling, but it can’t be expected to do ALL the work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to setup a binary socket connection in Flash to a server other
So I am trying to setup an entry posting system, where the user can
I am trying to setup a WCF Service with a self signed SSL. I
I'm trying to setup a inset shadow on a UIButton, Thanks to other SO
Trying to set up a self signed certificate, for our intranet's web services site.
Trying to setup a personal image upload/downloader webpage. I've viewed the msdn article on
Trying to setup a CodeIgniter based project for local development (LAMP stack), and once
Trying to setup some validation on the add to cart button for the dropdown
Trying to setup and get going with the RestKit library for a cocoa project
Im trying to setup my asp.net mvc page like the following image: The header

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.