dongyinting3179 2015-11-04 09:54
浏览 42
已采纳

doctrine SINGLE_TABLE InheritanceType获取所有行

i have entity

 * @ORM\InheritanceType("SINGLE_TABLE")
 * @ORM\DiscriminatorColumn(name="discr", type="string")
 */
class Contact extends BaseUser

and

class MyContact extends Contact
{

and have name MyBundle:MyContact name and want get all Contact rows not only MyContact how to do this ?

can i get base inheritance class for MyBundle:MyContact ?

  • 写回答

1条回答 默认 最新

  • dongshipang8094 2015-11-04 09:57
    关注

    You can just use the repository for the base entity:

    // assuming $entityManager is available
    $contactList = $entityManager
        ->getRepository('MyBundle:Contact')
        ->findAll();
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 chaquopy python 安卓
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 CSS实现渐隐虚线框
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容