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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:52:41+00:00 2026-05-18T19:52:41+00:00

Lets say that I have a table containing users . Each row in that

  • 0

Lets say that I have a table containing users. Each row in that table is thus a user. The important part here is the plural vs singular form.

Now, let’s look at the we set up models for these in Zend Framework:

class Model_Users extends Zend_Db_Table_Abstract
{
  protected $_name      = 'users';
  protected $_primary   = 'user_id';
}

Now, let’s further presume that we want another user object other than the standard row returned by the Zend_Db_Table, but we would still like to keep its functionality, just extend it. It would then make sense to implement and name a single user like:

class Model_User extends Zend_Db_Table_Row_Abstract
{
  ... Bunch of cool functions here :)
}

We then just add
protected $_rowClass = 'Model_User';
to the Model_Users class and we’re done… Normally that would be the case, but there seems to be a problem here in the way Zend Framework auto-loads the classes. Since we can have the folder structure /defaut/models/foo.php and name the class within that Model_Foo. The folder has a plural name but the class has a singular one. This seems to become a problem when I want to have the above stated structure. Since Zend Framework doesn’t seem to be able to differentiate between the UserModel.php and UsersModel.php.

So the question to this long and somewhat poetic question is:

Is there a way to get around this WITHOUT starting to manually use includes?

  • 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-18T19:52:42+00:00Added an answer on May 18, 2026 at 7:52 pm

    Actually it is recommended to put your table classes in db folder within models, so it would be models/dbtable/users.php and class name Model_DbTable_Users for table, and models/user.php and Model_User for concrete user. But if you decide to skip on that I don’t see the problem of having model/user.php with Model_User and models/users.php with Model_Users as table.

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

Sidebar

Related Questions

No related questions found

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.