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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:53:43+00:00 2026-06-07T04:53:43+00:00

I am experimenting this error when I execute orm:schema-tool:create. It’s my first time with

  • 0

I am experimenting this error when I execute orm:schema-tool:create. It’s my first time with Doctrinem, so I’ve got several doubts, the one which -I think- causes the error is that I’ve got a class Player with 3 array of Comment objects. My idea of the db scheme is:

player_comment(id_player,id_comment)
commentsliked(id_player,id_comment)
commentsdisliked(id_player,id_comment)

Notice that comments is a bidirectional relationship although commentsLiked and commentsDisliked are not.

As far as I’ve understood, Doctrine wants to name the 3 previous tables “player_comment”.

Thanks in advance.

My class Player look like this:

/**
 * @Entity @Table(name="players") 
 */
class Player
{
/** 
 * @Id @Column(type="integer") @GeneratedValue 
 * @var int
**/
private $id;

/** 
     * @OneToMany(targetEntity="Comment", mappedBy="writer")
 * @var Comment[]
    **/
private $comments = null;
/**
 * @ManyToMany(targetEntity="Comment")
     * @Table(name="commentsliked")
 * @var Comment[]
**/
private $commentsLiked = null;
/**
 * @ManyToMany(targetEntity="Comment")
     * @Table(name="commentsdisliked")
 * @var Comment[]
**/
private $commentDisliked = null;
}

My class Comment look like this:

/**
 * @Entity @Table(name="comments")
 */
class Comment {
/** 
 * @Id @Column(type="integer") @GeneratedValue 
 * @var int
**/
private $id;

/** 
     * @ManyToOne(targetEntity="Player", inversedBy="comments") 
 * @var Player
    **/
private $writer;
}
  • 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-07T04:53:46+00:00Added an answer on June 7, 2026 at 4:53 am

    I’ve used @JoinTable as indicated in http://docs.doctrine-project.org/en/latest/reference/association-mapping.html#many-to-many-unidirectional.

    I updated the annotations of commentsLiked and commentsDisliked:

    /**
     * @ManyToMany(targetEntity="Comment")
     * @JoinTable(name="commentsliked",
     * joinColumns={@JoinColumn(name="player_id", referencedColumnName="id")},
     * inverseJoinColumns={@JoinColumn(name="commment_id",referencedColumnName="id")})
     * @var Coments[]
    **/
    private $commentsLiked = null;
    /**
     * @ManyToMany(targetEntity="Comment")
     * @JoinTable(name="commentsDisliked",
     * joinColumns={@JoinColumn(name="player_id", referencedColumnName="id")},
     * inverseJoinColumns={@JoinColumn(name="comment_id",referencedColumnName="id")})     )
     * @var Comment[]
    **/
    private $commentsDisliked = null;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got this error: execute=#{localeManager.changeLocale}: Property 'changeLocale' not found on type xyz.com.i18n.LocaleManager where LocaleManager
I am experimenting with this code: foreach (var r in _vm.Rules.Take(20)) { Task.Factory.StartNew(() =>
I'm doing some experimenting with this malicious JavaScript line: var undefined = true; Every
I'm experimenting with knockout and the mapping plugin and wondering why this doesn't work.
I was experimenting a little with the C++11 standard and came up with this
I was experimenting with basic VB.Net File IO and String splitting. I encountered this
I'm experimenting playing video in a UIWebView. If I have some html like this:
I am experimenting with JavaScript Inheritance. Basically, I am following this tutorial. I see
I've been experimenting with tracking area, and having some problems, so I created this
I'm experimenting with XSLT2, using a stylesheet based on this answer: <xsl:stylesheet version=2.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform>

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.