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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:14:26+00:00 2026-05-18T01:14:26+00:00

Is there a convention for naming tables when using Doctrine ORM? I like to

  • 0

Is there a convention for naming tables when using Doctrine ORM? I like to name tables with the plural but if there’s a convention I want to stick to it.

So the table ‘users’ would be related to tables using the fk as the singular (‘user_id’).

Is there a best practice for this (using singular or plural table names) and if the latter, how does this apply to tables where the plural isn’t a simple case of adding an ‘s’.

For example I currently have a table called ‘categorys’ instead of ‘categories’ to maintain the convention of adding ‘s’.

Is this a sensible approach?

  • 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-18T01:14:27+00:00Added an answer on May 18, 2026 at 1:14 am

    I used to use plural table names when using my own basic ORM but I switched over to singular table names when I started using symfony + Propel and now a little bit of Doctrine. The reason for this is for the class names because you want to create a User and not a Users.

    With Doctrine, when it comes to collections or relations, you tell it what the alias should be:

    http://www.doctrine-project.org/projects/orm/1.2/docs/manual/working-with-models/en

    You’ll see the a User can have many Phonenumber so a foreignAlias was setup in the YAML schema so it would be Phonenumbers effectively accessed via $user->Phonenumbers.

    In your example you’ll set the foreignAlias to be Categories while keeping the table and record named Category.

    • 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.