Search code examples
doctrine-ormentity-relationshipsymfony-2.8

Cannot join entities with no error


Trying to set a relation between two entities.

Investigating with phpmyadmin showed no link between their tables.

/*
 * @ORM\OneToOne(targetEntity="Otherentity")
 */
private $otherentity;

instead of:

/**
 * @ORM\OneToOne(targetEntity="Otherentity")
 */
private $otherentity;

Even checking the coding standards did not helped me.


Solution

  • Answer found: typo in the comment structure itself.

    After searching in dozens of loosely related topics and tutos, I had to copy-paste existing relations and replace-in-place word after word... to find that the /** is mandatory as it is.

    And easily mistaken for /*. And no warning anywhere.

    Hope that helps anyone (at least myself, when it will happen again in several years).