diff --git a/src/Repository/MerServiceRepository.php b/src/Repository/MerServiceRepository.php index 6f0bd10..133370e 100644 --- a/src/Repository/MerServiceRepository.php +++ b/src/Repository/MerServiceRepository.php @@ -65,6 +65,12 @@ class MerServiceRepository extends ServiceEntityRepository // ; // } + /* + * offer_id is in MerDM, a trait used by MerParaDM for example. + * This field can't be used in MerService, so the idea is to do + * a partial load, and then refresh() the object to get all the + * fields. + */ public function findByOfferId(int $offerId) { // return $this->createQueryBuilder('s') @@ -81,7 +87,7 @@ class MerServiceRepository extends ServiceEntityRepository $rsm->setDiscriminatorColumn('s', 'discr'); $query = $this->getEntityManager() - ->createNativeQuery('SELECT * FROM mer_service m WHERE offer_id = :offer_id', $rsm); + ->createNativeQuery('SELECT m.id, m.discr FROM mer_service m WHERE offer_id = :offer_id', $rsm); $query->setParameter('offer_id', $offerId); $res = $query->getResult(); diff --git a/templates/index/notificationDm.html.twig b/templates/index/notificationDm.html.twig index ac8c6b5..161904e 100644 --- a/templates/index/notificationDm.html.twig +++ b/templates/index/notificationDm.html.twig @@ -4,7 +4,7 @@ {% block body %}

check profiler output

- +

MerServiceRepository->findByOfferId

{{ dump(serviceRepo) }}