UserServiceInterface
extends
DbServiceInterface
in
Database service interface for users.
Tags
Table of Contents
- createEntity() : UserEntityInterface
- Create a new user entity.
- createEntityForUsername() : UserEntityInterface
- Create an entity for the specified username.
- deleteUser() : void
- Delete a user entity.
- getAllUsersWithCatUsernames() : array<string|int, UserEntityInterface>
- Get all rows with catalog usernames.
- getInsecureRows() : array<string|int, UserEntityInterface>
- Get user rows with insecure catalog passwords.
- getUserByCatId() : UserEntityInterface|null
- Retrieve a user object by catalog ID. Returns null if no match is found.
- getUserByEmail() : UserEntityInterface|null
- Retrieve a user object by email address. Returns null if no match is found.
- getUserByField() : UserEntityInterface|null
- Retrieve a user object from the database based on the given field.
- getUserById() : UserEntityInterface|null
- Retrieve a user object from the database based on ID.
- getUserByUsername() : UserEntityInterface|null
- Retrieve a user object by username. Returns null if no match is found.
- getUserByVerifyHash() : UserEntityInterface|null
- Retrieve a user object by verify hash. Returns null if no match is found.
- persistEntity() : void
- Persist an entity.
- updateUserEmail() : void
- Update the user's email address, if appropriate. Note that this does NOT automatically save the row; it assumes a subsequent call will be made to persist the data.
Methods
createEntity()
Create a new user entity.
public
createEntity() : UserEntityInterface
Return values
UserEntityInterface —createEntityForUsername()
Create an entity for the specified username.
public
createEntityForUsername(string $username) : UserEntityInterface
Parameters
- $username : string
-
Username
Return values
UserEntityInterface —deleteUser()
Delete a user entity.
public
deleteUser(UserEntityInterface|int $userOrId) : void
Parameters
- $userOrId : UserEntityInterface|int
-
User entity object or ID to delete
Return values
void —getAllUsersWithCatUsernames()
Get all rows with catalog usernames.
public
getAllUsersWithCatUsernames() : array<string|int, UserEntityInterface>
Return values
array<string|int, UserEntityInterface> —getInsecureRows()
Get user rows with insecure catalog passwords.
public
getInsecureRows() : array<string|int, UserEntityInterface>
Return values
array<string|int, UserEntityInterface> —getUserByCatId()
Retrieve a user object by catalog ID. Returns null if no match is found.
public
getUserByCatId(string $catId) : UserEntityInterface|null
Parameters
- $catId : string
-
Catalog ID
Return values
UserEntityInterface|null —getUserByEmail()
Retrieve a user object by email address. Returns null if no match is found.
public
getUserByEmail(string $email) : UserEntityInterface|null
Parameters
- $email : string
-
Email address
Return values
UserEntityInterface|null —getUserByField()
Retrieve a user object from the database based on the given field.
public
getUserByField(string $fieldName, int|string|null $fieldValue) : UserEntityInterface|null
Field name must be id, username, email, verify_hash or cat_id.
Parameters
- $fieldName : string
-
Field name
- $fieldValue : int|string|null
-
Field value
Return values
UserEntityInterface|null —getUserById()
Retrieve a user object from the database based on ID.
public
getUserById(int $id) : UserEntityInterface|null
Parameters
- $id : int
-
ID.
Return values
UserEntityInterface|null —getUserByUsername()
Retrieve a user object by username. Returns null if no match is found.
public
getUserByUsername(string $username) : UserEntityInterface|null
Parameters
- $username : string
-
Username
Return values
UserEntityInterface|null —getUserByVerifyHash()
Retrieve a user object by verify hash. Returns null if no match is found.
public
getUserByVerifyHash(string $hash) : UserEntityInterface|null
Parameters
- $hash : string
-
Verify hash
Return values
UserEntityInterface|null —persistEntity()
Persist an entity.
public
persistEntity(EntityInterface $entity) : void
Parameters
- $entity : EntityInterface
-
Entity to persist.
Return values
void —updateUserEmail()
Update the user's email address, if appropriate. Note that this does NOT automatically save the row; it assumes a subsequent call will be made to persist the data.
public
updateUserEmail(UserEntityInterface $user, string $email[, bool $userProvided = false ]) : void
Parameters
- $user : UserEntityInterface
-
User entity to update
- $email : string
-
New email address
- $userProvided : bool = false
-
Was this email provided by the user (true) or an automated lookup (false)?