Conditions | 6 |
Paths | 5 |
Total Lines | 21 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | public function findSimilarProperties(Property $property): array |
||
14 | { |
||
15 | if (!$this->isModuleEnabled()) { |
||
16 | return []; |
||
17 | } |
||
18 | |||
19 | if ($property->getNeighborhood()) { |
||
20 | // Find in a small area |
||
21 | $result = $this->findByArea($property, 'neighborhood'); |
||
22 | |||
23 | if (empty($result) && $property->getDistrict()) { |
||
24 | // Find in a larger area |
||
25 | $result = $this->findByArea($property); |
||
26 | } |
||
27 | |||
28 | return $result; |
||
29 | } elseif ($property->getDistrict()) { |
||
30 | return $this->findByArea($property); |
||
31 | } |
||
32 | |||
33 | return []; |
||
34 | } |
||
61 |