MedicalCenterService
in package
A class service for working with the logic business of medical centers.
Tags
Table of Contents
- $medicalCenterRepository : MedicalCenterRepository
- $municipalityRepository : MunicipalityRepository
- $provinceRepository : ProvinceRepository
- $timeZoneService : TimeZoneService
- __construct() : mixed
- MedicalCenterService constructor.
- findAll() : array<string|int, mixed>
- Find all medical centers.
- findById() : MedicalCenterDomain
- Find a medical center by its ID.
- findByPostalCode() : MedicalCentersByPostalCodeResponseDomain
- Find all medical centers by postal code.
- getMunicipalityByPostalCode() : MunicipalityDomain
- Get the municipality by postal code.
- mapMedicalCenterEntitiesToDomains() : array<string|int, mixed>
- Map medical center entities to domains.
- mapMedicalCenterEntityToDomain() : MedicalCenterDomain
- Map a medical center entity to a domain.
Properties
$medicalCenterRepository
private
MedicalCenterRepository
$medicalCenterRepository
The medical center repository.
$municipalityRepository
private
MunicipalityRepository
$municipalityRepository
The municipality repository.
$provinceRepository
private
ProvinceRepository
$provinceRepository
The province repository.
$timeZoneService
private
TimeZoneService
$timeZoneService
The time zone service.
Methods
__construct()
MedicalCenterService constructor.
public
__construct(MedicalCenterRepository $medicalCenterRepository, MunicipalityRepository $municipalityRepository, ProvinceRepository $provinceRepository, TimeZoneService $timeZoneService) : mixed
Parameters
- $medicalCenterRepository : MedicalCenterRepository
-
The medical center repository.
- $municipalityRepository : MunicipalityRepository
-
The municipality repository.
- $provinceRepository : ProvinceRepository
-
The province repository.
- $timeZoneService : TimeZoneService
-
The time zone service.
Return values
mixed —findAll()
Find all medical centers.
public
findAll() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —findById()
Find a medical center by its ID.
public
findById(int $id) : MedicalCenterDomain
Parameters
- $id : int
-
The ID of the medical center to find.
Tags
Return values
MedicalCenterDomain —findByPostalCode()
Find all medical centers by postal code.
public
findByPostalCode(int $postalCode) : MedicalCentersByPostalCodeResponseDomain
Parameters
- $postalCode : int
-
The postal code to find the medical centers.
Tags
Return values
MedicalCentersByPostalCodeResponseDomain —getMunicipalityByPostalCode()
Get the municipality by postal code.
private
getMunicipalityByPostalCode(int $postalCode) : MunicipalityDomain
Parameters
- $postalCode : int
-
The postal code to find the municipality.
Tags
Return values
MunicipalityDomain —mapMedicalCenterEntitiesToDomains()
Map medical center entities to domains.
private
mapMedicalCenterEntitiesToDomains(array<string|int, MedicalCenterEntity> $data) : array<string|int, mixed>
Parameters
- $data : array<string|int, MedicalCenterEntity>
-
The medical center entities.
Tags
Return values
array<string|int, mixed> —mapMedicalCenterEntityToDomain()
Map a medical center entity to a domain.
private
mapMedicalCenterEntityToDomain(MedicalCenterEntity $entity) : MedicalCenterDomain
Parameters
- $entity : MedicalCenterEntity
-
The medical center entity.