我有实体 语言,路线,页面。语言与Route相关,Route与Route相关。当我获得页面时,我需要自动语言实体。 是否可以将语言实体连接到页面实体而不在页面表中创建列?
class Language {
......
}
class Route {
/**
* @ORM\ManyToOne(targetEntity="Language")
* @ORM\JoinColumn(name="languages_id", referencedColumnName="id")
* @var Language
*/
protected $language;
}
class Page {
/**
* @ORM\ManyToOne(targetEntity="Route")
* @ORM\JoinColumn(name="routes_id")
* @var Route
*/
protected $route;
/**
* Is possible join language Entity without create column in page table?
*/
protected $language;
}