Prueba así. Más o menos. No lo he probado.
Aquí tienes más ayuda:
http://doctrine-orm.readthedocs.org/...n-mapping.html
Código PHP:
Ver original<?php
namespace VnfqInstComBundleEntity;
use DoctrineORMMapping as ORM;
use DoctrineCommonCollectionsArrayCollection;
/**
* InstCom
*
* @ORM\Table(name="installation_companies")
* @ORM\Entity(repositoryClass="Vnfq\InstComBundle\Repository\InstComRepository")
*/
class InstCom
{
/**
* @ORM\OneToMany(targetEntity="District", mappedBy="instcom")
*/
protected $districts;
/**
* @ORM\OneToMany(targetEntity="State", mappedBy="instcom")
*/
protected $states;
public function __construct()
{
$this->districts = new ArrayCollection();
$this->states = new ArrayCollection();
}
Código PHP:
Ver original<?php
namespace VnfqInstComBundleEntity;
use DoctrineORMMapping as ORM;
/**
* Disctrict
*
* @ORM\Table(name="disctricts_brasil")
* @ORM\Entity(repositoryClass="Vnfq\InstComBundle\Repository\DisctrictRepository")
*/
class Disctrict
{
/**
* @ORM\ManyToOne(targetEntity="InstCom", inversedBy="districts")
* @ORM\JoinColumn(name="districts", referencedColumnName="id")
*/
protected $instcom;
Código PHP:
Ver original<?php
namespace VnfqInstComBundleEntity;
use DoctrineORMMapping as ORM;
/**
* State
*
* @ORM\Table(name="states_brasil")
* @ORM\Entity(repositoryClass="Vnfq\InstComBundle\Repository\StateRepository")
*/
class State
{
/**
* @ORM\ManyToOne(targetEntity="InstCom", inversedBy="states")
* @ORM\JoinColumn(name="states", referencedColumnName="id")
*/
protected $instcom;