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

The Archive Base Latest Questions

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

Im sort of scratching my head on this one. Here’s the scenario. Im using

  • 0

Im sort of scratching my head on this one. Here’s the scenario. Im using Doctrine and YAML schema files:

I have a table User and a table Event

User looks like this:

User:
    columns:
        id:
            type: integer(7)
        email:          
            type: string(100)
        display_name:
            type: string(255)
        fb_id:
            type: string(100)
    relations:
        Event:
            type: many
            refClass: UserEvent

Event looks like this:

Event:
    columns:
        id:
            type: integer(7)
        initiator_id:          
            type: integer(7)
        loc_latitude: 
            type: decimal(11)
        loc_longitude: 
            type: decimal(11)
        4sq_id:
            type: integer(11)
    relations:
        User:
            type: one
            local: initiator_id
            foreign: id
        User:
            type: many
            refClass: UserEvent

As you can see the problem is this: A User (or ‘initiator’) can start many events, and an event can belong to one User (‘initiator’). However, an event can also have many Users who join it, and a User can Join many events.

So Event and User end up being related in two different fashions. How does this work? Is it possible to do it this way or am i missing something?

  • 1 1 Answer
  • 2 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:10:46+00:00Added an answer on May 23, 2026 at 12:10 am

    I think you just need one many-to-many relationship between the two tables. UserEvent will tell you what users have what events (and vice versa)… and joining through UserEvent and adding WHERE user.id = event.initiator_id will give you access to a user’s initiated events, assuming they also belong to those events.

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

Sidebar

Related Questions

I've been scratching my head for hours trying to figure this out. I have
I sort of understand why this is happening, but not entirely. I have a
Sort by using a binary predicate and std::sort I need the sample for this...
Sort of a mongo noob, and I have a feeling I am tackling this
Sort of the reverse of finding duplicate rows. I have a table with a
Sort of a methods/best practices question here that I am sure has been addressed,
I sort of understand this, at least the function of generators (I've used them
I have to deal with various input files with a number of fields, arbitrarily
Sort of a spinoff of this question. Do you keep them in the source
Sort of a fringy, non-practical question coming along here. You know that in Perl

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.