我有抽象实体(App - 基础核心):
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
当我将实体设置为抽象类 App 时,学说创建一个新表“App”当我将 MappedSuperClass 设置为抽象类 App 时,出现错误:http ://docs.doctrine-project.org/en/latest/reference/inheritance -mapping.html#mapped-superclasses
如何创建从 AppHistory 到抽象核心 App 的关系?