我有抽象實體(應用程序 - 基核心):如何設置固定實體關係在學說2
namespace App\Bundles\AppBundle\Entity;
abstract class App extends ContainerAware implements AppInterface
{
// .....
}
和自實體:
namespace AppRus\Bundles\AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM,
App\Bundles\AppBundle\Entity\App as BaseApp;
/**
* App
*
* @ORM\Table(name="apps")
* @ORM\Entity(repositoryClass="AppRus\Bundles\AppBundle\Entity\AppRepository")
*/
class App extends BaseApp
{
// ....
}
和實體控制的修改:
namespace App\Bundles\AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* AppHistory
*
* @ORM\Table(name="apps_history")
* @ORM\Entity(repositoryClass="App\Bundles\AppBundle\Entity\AppHistoryRepository")
*/
class AppHistory
{
/**
* @var integer
*
* @ORM\ManyToOne(targetEntity="App\Bundles\AppBundle\Entity\App")
* @ORM\JoinColumn(name="app_apple_id", referencedColumnName="apple_id")
*/
private $app;
}
我無法創建關係AppHistory#app到App#apple_id
當我設置實體抽象類應用程序,然後學說創建新表「應用程序」 當我設置MappedSuperClass抽象類的應用程序,我有錯誤:http://docs.doctrine-project.org/en/latest/reference/inheritance-mapping.html#mapped-superclasses
如何從AppHistory創建相對於抽象的核心應用?
可以嘗試更換目標實體學說事件偵聽器(loadClassMetadata),但在文件 - 屬性$ associationMappings是公開的,只讀的 – ZhukV