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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:27:49+00:00 2026-06-01T04:27:49+00:00

I am developing a social network for an intranet, and I came across a

  • 0

I am developing a social network for an intranet, and I came across a problem [?]. I have the entities User and Business as main entities of the network.

Note: A Business does not have, necessarily, a relationship with a User.

Following this idea, I have a group table, and a group can be created either by a user or by a business, there comes a question, how can I make the author field in this table?

I did the following, I created a table type, with the following data:

 id | name
  1   user
  2   business

And my table groups like this:

 id
 name
 description
 tid (FK -> type.id)
 author (INT)

Thus, if a group has a tid equals to 1, means that the author is referring to a User, if it have tid equals to 2, it is referring to a Business.

What do you think about this implementation? It is correct?
What can I do to improve it?

I’m using PHP 5.3.6 (Zend Framework and Doctrine2) + MySQL 5.1.

  • 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-01T04:27:50+00:00Added an answer on June 1, 2026 at 4:27 am

    Per request:

    The terminology for this is “polymorphic”. Bill Karwin had a good answer that I can’t find at the moment about it. From a database design perspective, I’ve been told the logical model term for this is an “arc” relationship. Either way, I see no issues with what you posted, other than supporting multiple authors.

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

Sidebar

Related Questions

I am developing a balloon notification for my social network. I came across this
I'm developing android app. It's some sort of social network. Where user can add
I'm developing a social network where each user is registered through Facebook. So I
I am developing a social network from scratch and need to store the user's
I am developing a social network from scratch and need to store the user's
In this period we are developing something similar to a social network (where user
I'm in the process of developing a social network site. And been thinking of
I've been evaluating technology stack for developing a social network based application. Below are
I'm developing a social network using Microsoft Technologies. I want to make a Wall
I have an idea of a social network website and I will be working

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.