| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 36 | private function findByArea(Property $property, string $area = 'district'): array |
||
| 37 | { |
||
| 38 | $qb = $this->createQueryBuilder('p') |
||
| 39 | ->where("p.state = 'published'") |
||
| 40 | ->andWhere('p.id != '.(int) ($property->getId())) |
||
| 41 | ->andWhere('p.deal_type = '.(int) ($property->getDealType()->getId())) |
||
| 42 | ->andWhere('p.category = '.(int) ($property->getCategory()->getId())); |
||
| 43 | |||
| 44 | if ('neighborhood' === $area) { |
||
| 45 | $qb->andWhere('p.neighborhood = '.(int) ($property->getNeighborhood()->getId())); |
||
| 46 | } else { |
||
| 47 | $qb->andWhere('p.district = '.(int) ($property->getDistrict()->getId())); |
||
| 48 | } |
||
| 49 | |||
| 50 | return $qb->getQuery()->setMaxResults(self::NUM_ITEMS)->getResult(); |
||
|
|
|||
| 51 | } |
||
| 61 |