DatabaseEventRegistrationRepository
in package
implements
IEventRegistrationRepository
Database-backed event registration repository.
Works with SQLite, MySQL, and PostgreSQL.
Table of Contents
Interfaces
- IEventRegistrationRepository
- Repository interface for EventRegistration entities.
Properties
- $_pdo : PDO
Methods
- __construct() : mixed
- countByEvent() : int
- Count registrations for an event.
- create() : EventRegistration
- Persist a registration and return it with its new id.
- delete() : bool
- Delete a registration by id.
- existsForEmail() : bool
- Determine whether an email is already registered for an event (active registrations only).
- findById() : EventRegistration|null
- Find a registration by id.
- getByEvent() : array<string|int, EventRegistration>
- Get all registrations for an event, newest first.
- paginate() : EventRegistration[], total: int, page: int, per_page: int, pages: int}
- Return a page of registrations, newest first, optionally filtered by event.
Properties
$_pdo
protected
PDO
$_pdo
Methods
__construct()
public
__construct(SettingManager $settings) : mixed
Parameters
- $settings : SettingManager
-
Settings manager with database configuration
Tags
countByEvent()
Count registrations for an event.
public
countByEvent(int $eventId) : int
Parameters
- $eventId : int
Tags
Return values
intcreate()
Persist a registration and return it with its new id.
public
create(EventRegistration $registration) : EventRegistration
Parameters
- $registration : EventRegistration
Tags
Return values
EventRegistrationdelete()
Delete a registration by id.
public
delete(int $id) : bool
Parameters
- $id : int
Tags
Return values
boolexistsForEmail()
Determine whether an email is already registered for an event (active registrations only).
public
existsForEmail(int $eventId, string $email) : bool
Parameters
- $eventId : int
- $email : string
Tags
Return values
boolfindById()
Find a registration by id.
public
findById(int $id) : EventRegistration|null
Parameters
- $id : int
Tags
Return values
EventRegistration|nullgetByEvent()
Get all registrations for an event, newest first.
public
getByEvent(int $eventId) : array<string|int, EventRegistration>
Parameters
- $eventId : int
Tags
Return values
array<string|int, EventRegistration>paginate()
Return a page of registrations, newest first, optionally filtered by event.
public
paginate([int $page = 1 ][, int $perPage = 25 ][, int|null $eventId = null ]) : EventRegistration[], total: int, page: int, per_page: int, pages: int}
Parameters
- $page : int = 1
-
Page number (1-based)
- $perPage : int = 25
-
Items per page
- $eventId : int|null = null
-
Optional event filter