|
@@ -12,18 +12,18 @@ class ONURepository extends \Doctrine\ORM\EntityRepository
|
|
|
*/
|
|
|
public function findByOLTSlotLink($nap, $id = null)
|
|
|
{
|
|
|
- $qb = $this->createQueryBuilder('ONU')
|
|
|
- ->join('ONU.nap', 'NAP')
|
|
|
- ->andWhere('NAP.olt = :olt')
|
|
|
- ->andWhere('NAP.slot = :slot')
|
|
|
- ->andWhere('NAP.link = :link');
|
|
|
+ $qb = $this->createQueryBuilder('ONU');
|
|
|
+ $qb->join('ONU.nap', 'NAP')
|
|
|
+ ->andWhere($qb->expr()->eq('NAP.olt', ':olt'))
|
|
|
+ ->andWhere($qb->expr()->eq('NAP.slot', ':slot'))
|
|
|
+ ->andWhere($qb->expr()->eq('NAP.link', ':link'));
|
|
|
$parameters = [
|
|
|
'olt' => $nap->getOlt(),
|
|
|
'slot' => $nap->getSlot(),
|
|
|
'link' => $nap->getLink(),
|
|
|
];
|
|
|
if (!is_null($id)) {
|
|
|
- $qb->andWhere('ONU.id <> :id');
|
|
|
+ $qb->andWhere($qb->expr()->neq('ONU.id', ':id'));
|
|
|
$parameters['id'] = $id;
|
|
|
}
|
|
|
$qb->setParameters($parameters);
|