Feature: add api endpoint for listing all geographical units covering an address

This commit is contained in:
2023-03-15 14:52:25 +01:00
parent b740a88ae3
commit 71d0785ab4
5 changed files with 169 additions and 4 deletions

View File

@@ -11,8 +11,23 @@ declare(strict_types=1);
namespace Chill\MainBundle\Repository;
use Chill\MainBundle\Entity\Address;
use Chill\MainBundle\Entity\GeographicalUnit\SimpleGeographicalUnitDTO;
use Doctrine\Persistence\ObjectRepository;
interface GeographicalUnitRepositoryInterface extends ObjectRepository
{
/**
* Return the geographical units as @link{SimpleGeographicalUnitDTO} whithin the address is contained.
*
* This query is executed in real time (without the refresh of the materialized view which load the addresses).
*
* @param Address $address
* @param int $offset
* @param int $limit
* @return SimpleGeographicalUnitDTO[]
*/
public function findGeographicalUnitContainingAddress(Address $address, int $offset = 0, int $limit = 50): array;
public function countGeographicalUnitContainingAddress(Address $address): int;
}