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 6080919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:07:00+00:00 2026-05-23T11:07:00+00:00

I have a CakePHP model which looks like this (and works fine): class Paper

  • 0

I have a CakePHP model which looks like this (and works fine):

class Paper extends AppModel {
      var $name = 'Paper';
      var $displayField = 'id';
}

This gives no error since I have a papers table in my database.

When I change the model to so (I simply add that last line):

class Paper extends AppModel {
      var $name = 'Paper';
      var $displayField = 'id';

      var $belongsTo = 'User';
}

I get the error:

Missing Database Table

Error: Database table ps for model Papers was not found.

Notice: If you want to customize this error message, create app\views\errors\missing_table.ctp

What could be going wrong that CakePHP suddenly assumes some first and last character nomenclature on adding a belongsTo line?

EDIT

I may be wrong with this, but shouldn’t the error say model Paper? It’s saying Papers instead. This happens after adding the belongsTo statement. Is this where the error is?

  • 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-23T11:07:00+00:00Added an answer on May 23, 2026 at 11:07 am

    I managed to fix this issue.

    Simply put, model-model links are not a one-way street as the CakePHP documentation calls it.

    For example if model A belongsTo model B, then model B MUST hasOne or hasMany model A.

    In my case, syntax at the receiving end was faulty.

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

Sidebar

Related Questions

In my CakePHP application, I have a model like this: class Duck extends AppModel
I have a form which looks like this: Delete [Publisher One ] [] [Publisher
I have a CakePHP Console Shell that works fine until a Model->afterFind() tries to
I have CakePHP app in which I'd like to attach gallery to multiple resources.
I have a local cakephp 1.2 app which was working fine last night. Currently
I have a json array in my Particles controller that looks like this after
I want to truncate my Database Table, with CakePHP Model, I have used $this->Model->deleteAll
I am testing a model in CakePHP 2 and have mocked a model like
I am not sure of the cakephp way to do this. My model looks
I am using CakePHP 2.0 and I have a Model with this 'virtualFields': Country.php:

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.