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

  • Home
  • SEARCH
  • 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 6000663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:43:34+00:00 2026-05-23T00:43:34+00:00

I am new to cakephp and I can’t seem to get the relationship right

  • 0

I am new to cakephp and
I can’t seem to get the relationship right in the following scenario:

I have a database with 2 tables, clients and events. Clients can have many events, events belongs to one client, but sometimes events don’t belong to a client, or the client detail is not known when the event needs to be entered.

Is there a way to have cakephp not enforce a relationship?

  • 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-05-23T00:43:35+00:00Added an answer on May 23, 2026 at 12:43 am

    It won’t matter. If you do a Event->find( … ) and there is no linked Client the results will simply have an empty ‘Client’ => array( ) in the returned results.

    As for not entering a client, make sure you can select an empty option in the drop-down where you would select a client for the event. Also, make sure the field allows validation to pass when you try and save a blank client_id.

    Nothing tricky here – the basics will work just fine for you out of the box.

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

Sidebar

Related Questions

I'm new to cakephp and following this tutorial. http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html I have created the blog
I'm kind of new to cakePHP and get to the moment where i have
I'm extremely new to CakePHP. From what I've gathered, it seems like I can
I'm new to cakephp so go easy on me! I have a table called
I'm new to cakephp, but from what I understand all of the database interaction
I'm new to cakephp so have just been working through the cookbook and am
I'm pretty new to CakePHP but I think I'm starting to get the hang
I have a new CakePHP site, and I wish to redirect some old urls
I am new to cakephp and security. I have read that security is built
I'm very new to CakePHP. I want to do a query in my database

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.