ExceptionService
in package
A class service for working with the logic business of exceptions (holidays and special days).
Tags
Table of Contents
- $exceptionRepository : ExceptionRepository
- $medicalCenterService : MedicalCenterService
- $timeZoneService : TimeZoneService
- __construct() : mixed
- ExceptionService constructor.
- delete() : void
- Delete an exception by id.
- findByMedicalCenterId() : array<string|int, mixed>
- Find all exceptions for a medical center.
- save() : ExceptionDomain
- Save an exception.
- checkOverlap() : void
- Check if an exception overlaps with another exception.
- mapExceptionDomainToEntity() : ExceptionEntity
- Map an exception domain to an entity object.
- mapExceptionEntityToDomain() : ExceptionDomain
- Convert an exception entity to a domain object.
Properties
$exceptionRepository
private
ExceptionRepository
$exceptionRepository
The exception repository.
$medicalCenterService
private
MedicalCenterService
$medicalCenterService
The medical center service.
$timeZoneService
private
TimeZoneService
$timeZoneService
The time zone service.
Methods
__construct()
ExceptionService constructor.
public
__construct(ExceptionRepository $exceptionRepository, MedicalCenterService $medicalCenterService, TimeZoneService $timeZoneService) : mixed
Parameters
- $exceptionRepository : ExceptionRepository
-
The exception repository.
- $medicalCenterService : MedicalCenterService
-
The medical center service.
- $timeZoneService : TimeZoneService
-
The time zone service.
Return values
mixed —delete()
Delete an exception by id.
public
delete(int $id) : void
Parameters
- $id : int
Tags
Return values
void —findByMedicalCenterId()
Find all exceptions for a medical center.
public
findByMedicalCenterId(int $medicalCenterId) : array<string|int, mixed>
Parameters
- $medicalCenterId : int
Tags
Return values
array<string|int, mixed> —save()
Save an exception.
public
save(ExceptionDomain $exceptionDomain) : ExceptionDomain
Parameters
- $exceptionDomain : ExceptionDomain
Tags
Return values
ExceptionDomain —checkOverlap()
Check if an exception overlaps with another exception.
private
checkOverlap(ExceptionDomain $exceptionDomain) : void
Parameters
- $exceptionDomain : ExceptionDomain
Tags
Return values
void —mapExceptionDomainToEntity()
Map an exception domain to an entity object.
private
mapExceptionDomainToEntity(ExceptionDomain $exceptionDomain) : ExceptionEntity
Parameters
- $exceptionDomain : ExceptionDomain
-
The exception domain object.
Return values
ExceptionEntity —The new exception entity.
mapExceptionEntityToDomain()
Convert an exception entity to a domain object.
private
mapExceptionEntityToDomain(ExceptionEntity $exceptionEntity) : ExceptionDomain
Parameters
- $exceptionEntity : ExceptionEntity