DoDomuDojade Documentation

PDOCountdownRepository
in package
implements CountdownRepositoryInterface

Read onlyYes
Tags
inheritDoc

Table of Contents

Interfaces

CountdownRepositoryInterface
Describes behavior of the countdown repository

Properties

$DATE_FORMAT  : string
$dbHelper  : DatabaseService
$TABLE_NAME  : string

Methods

__construct()  : mixed
add()  : int
Persists a new countdown entity.
delete()  : bool
Deletes a countdown by its ID.
findAll()  : array<string|int, Countdown>
Retrieves all countdowns from storage.
findById()  : Countdown|null
Finds a countdown by its ID.
findCurrent()  : Countdown|null
Finds the current active countdown (with count_to in the future).
update()  : bool
Updates an existing countdown entity.
updateField()  : bool
Updates a specific field in a countdown.
mapRow()  : Countdown
Maps database row to Countdown entity.

Properties

Methods

add()

Persists a new countdown entity.

public add(Countdown $countdown) : int
Parameters
$countdown : Countdown

The countdown entity to add

Tags
inheritDoc
Return values
int

The ID of the newly inserted countdown

delete()

Deletes a countdown by its ID.

public delete(int $id) : bool
Parameters
$id : int

The countdown ID to delete

Tags
inheritDoc
Return values
bool

True if deletion was successful, false otherwise

findAll()

Retrieves all countdowns from storage.

public findAll() : array<string|int, Countdown>
Tags
inheritDoc
Return values
array<string|int, Countdown>

Array of all countdown entities

findById()

Finds a countdown by its ID.

public findById(int $id) : Countdown|null
Parameters
$id : int

The countdown ID

Tags
inheritDoc
Return values
Countdown|null

The countdown entity or null if not found

findCurrent()

Finds the current active countdown (with count_to in the future).

public findCurrent() : Countdown|null
Tags
inheritDoc
Return values
Countdown|null

The current countdown or null if none exists

update()

Updates an existing countdown entity.

public update(Countdown $countdown) : bool
Parameters
$countdown : Countdown

The countdown entity with updated data

Tags
inheritDoc
Return values
bool

True if update was successful, false otherwise

updateField()

Updates a specific field in a countdown.

public updateField(int $id, string $field, string $value) : bool
Parameters
$id : int

The countdown ID

$field : string

The field name to update

$value : string

The new value for the field

Tags
inheritDoc
Return values
bool

True if the update was successful, false otherwise

mapRow()

Maps database row to Countdown entity.

private mapRow(array<string|int, mixed> $row) : Countdown
Parameters
$row : array<string|int, mixed>
Tags
throws
Exception
Return values
Countdown

        
On this page

Search results