I need some help when select only discriminator column from doctrine 2 when run the DQL below
SELECT p.type FROM AppBundle\\Entity\\Product p
There is no direct access to the discriminator column.
It may happen that the entities of a special type should be queried. Because there is no direct access to the discriminator column, Doctrine provides the INSTANCE OF construct.
You can query for the type of your entity using the INSTANCE OF DQL as described in the docs. As example:
$query = $em->createQuery("SELECT product FROM AppBundle\Entity\AbstractProduct product WHERE product INSTANCE OF AppBundle\Entity\Product");
$products = $query->getResult();
Hope this helps