J
J
JohnDaniels2019-12-05 10:11:22
Doctrine ORM
JohnDaniels, 2019-12-05 10:11:22

How to correctly describe such a connection in doctrine?

I'm trying to do many-to-many, the problem is that only one key points to the intermediate table.
That is, something like this:
5de8ac1623435314361611.png
I mastered the country-> city and city-> people connections, but country-> people are needed.

class Country
{
    /**
     * @var ArrayCollection
     *
     * @ORM\OneToMany(targetEntity="City", mappedBy="country")
     */
    private $cities;

    /**
    *    ???????
    */
    private $peoples;
}

Although in theory there is one-to-many, I
don’t even know how to google such a situation.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question