PDOModuleRepository
in package
implements
ModuleRepositoryInterface
Read onlyYes
Tags
Table of Contents
Interfaces
- ModuleRepositoryInterface
- Describes behavior of the module repository
Constants
- DEFAULT_END_TIME = '23:59:59'
- DEFAULT_START_TIME = '00:00:00'
Properties
- $DATE_FORMAT : string
- $dbHelper : DatabaseService
- $TABLE_NAME : string
Methods
- __construct() : mixed
- findAll() : array<string|int, Module>
- Retrieves all modules from storage.
- findById() : Module|null
- Finds a module by its ID.
- findByName() : Module|null
- Finds a module by its name.
- update() : bool
- Updates an existing module entity.
- mapRow() : Module
- Maps array from database to entity
Constants
DEFAULT_END_TIME
private
mixed
DEFAULT_END_TIME
= '23:59:59'
DEFAULT_START_TIME
private
mixed
DEFAULT_START_TIME
= '00:00:00'
Properties
$DATE_FORMAT
private
string
$DATE_FORMAT
$dbHelper
private
DatabaseService
$dbHelper
$TABLE_NAME
private
string
$TABLE_NAME
Methods
__construct()
public
__construct(DatabaseService $dbHelper, string $TABLE_NAME, string $DATE_FORMAT) : mixed
Parameters
- $dbHelper : DatabaseService
- $TABLE_NAME : string
- $DATE_FORMAT : string
findAll()
Retrieves all modules from storage.
public
findAll() : array<string|int, Module>
Tags
Return values
array<string|int, Module> —Array of all module entities
findById()
Finds a module by its ID.
public
findById(int $id) : Module|null
Parameters
- $id : int
-
The module ID
Tags
Return values
Module|null —The module entity or null if not found
findByName()
Finds a module by its name.
public
findByName(ModuleName $moduleName) : Module|null
Parameters
- $moduleName : ModuleName
-
The module name value object
Tags
Return values
Module|null —The module entity or null if not found
update()
Updates an existing module entity.
public
update(Module $module) : bool
Parameters
- $module : Module
-
The module entity with updated data
Tags
Return values
bool —True if update was successful, false otherwise
mapRow()
Maps array from database to entity
private
mapRow(array<string|int, mixed> $row) : Module
Parameters
- $row : array<string|int, mixed>