Developer
Developer

Reputation: 2895

doctrine SINGLE_TABLE InheritanceType get all rows

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 ?

Upvotes: 0

Views: 111

Answers (1)

hanzi
hanzi

Reputation: 2987

You can just use the repository for the base entity:

// assuming $entityManager is available
$contactList = $entityManager
    ->getRepository('MyBundle:Contact')
    ->findAll();

Upvotes: 1

Related Questions