DoDomuDojade Documentation

PDOUserRepository
in package
implements UserRepositoryInterface

Read onlyYes
Tags
inheritDoc

Table of Contents

Interfaces

UserRepositoryInterface
Describes user repository behavior

Properties

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

Methods

__construct()  : mixed
add()  : int
Persists a new user entity.
delete()  : bool
Deletes a user by its ID.
findAll()  : array<string|int, User>
Retrieves all users from storage.
findByExactUsername()  : User|null
Finds a user by exact username match.
findById()  : User
Finds a user by its ID.
findByUsernamePartial()  : array<string|int, User>
Finds a user by partial username match.
update()  : bool
Updates an existing user entity.
updatePassword()  : bool
Updates user password hash.
mapRow()  : User
Maps database row to User entity.

Properties

Methods

add()

Persists a new user entity.

public add(User $user) : int
Parameters
$user : User

The user entity to add

Tags
inheritDoc
Return values
int

user id

delete()

Deletes a user by its ID.

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

The user ID to delete

Tags
inheritDoc
Return values
bool

True if deletion was successful, false otherwise

findAll()

Retrieves all users from storage.

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

Array of all user entities

findByExactUsername()

Finds a user by exact username match.

public findByExactUsername(string $username) : User|null
Parameters
$username : string

The username to search for

Tags
inheritDoc
Return values
User|null

The user entity or null if not found

findById()

Finds a user by its ID.

public findById(int $id) : User
Parameters
$id : int

The user ID

Tags
inheritDoc
Return values
User

The user entity

findByUsernamePartial()

Finds a user by partial username match.

public findByUsernamePartial(string $username) : array<string|int, User>
Parameters
$username : string

The partial username to search for

Tags
inheritDoc
Return values
array<string|int, User>

Array of matching user entities

update()

Updates an existing user entity.

public update(User $user) : bool
Parameters
$user : User

The user entity with updated data

Tags
inheritDoc
Return values
bool

True if update was successful, false otherwise

updatePassword()

Updates user password hash.

public updatePassword(int $id, string $newPasswordHash) : bool
Parameters
$id : int

The user ID

$newPasswordHash : string

The new password hash

Tags
inheritDoc
Return values
bool

True if update was successful, false otherwise

mapRow()

Maps database row to User entity.

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

        
On this page

Search results