none
This commit is contained in:
parent
d42bfa124a
commit
a8404a33bd
|
@ -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)
|
public function findByOfferId(int $offerId)
|
||||||
{
|
{
|
||||||
// return $this->createQueryBuilder('s')
|
// return $this->createQueryBuilder('s')
|
||||||
|
@ -81,7 +87,7 @@ class MerServiceRepository extends ServiceEntityRepository
|
||||||
$rsm->setDiscriminatorColumn('s', 'discr');
|
$rsm->setDiscriminatorColumn('s', 'discr');
|
||||||
|
|
||||||
$query = $this->getEntityManager()
|
$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);
|
$query->setParameter('offer_id', $offerId);
|
||||||
|
|
||||||
$res = $query->getResult();
|
$res = $query->getResult();
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<p>check profiler output</p>
|
<p>check profiler output</p>
|
||||||
|
|
||||||
<h1>MerServiceRepository->findByOfferId</h1>
|
<h1>MerServiceRepository->findByOfferId</h1>
|
||||||
{{ dump(serviceRepo) }}
|
{{ dump(serviceRepo) }}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue