UserException
extends DomainException
in package
FinalYes
User domain exceptions - contains translation KEYS
Table of Contents
Properties
- $context : array<string|int, mixed>
- $errorCode : string
- $httpStatusCode : int
Methods
- __construct() : mixed
- cannotDeleteSelf() : self
- Cannot delete an own user account
- emptyFields() : self
- Required fields are empty
- failedToCreate() : self
- Failed to create user
- failedToDelete() : self
- Failed to delete user
- invalidId() : self
- Invalid or missing user ID
- notFound() : self
- User isn't found in database
- unauthorized() : self
- User isn't authorized to perform this action
- usernameTaken() : self
- Username already exists
Properties
$context read-only
public
array<string|int, mixed>
$context
= []
$errorCode read-only
public
string
$errorCode
$httpStatusCode read-only
public
int
$httpStatusCode
= 400
Methods
__construct()
public
__construct(string $message, string $errorCode[, int $httpStatusCode = 400 ][, array<string|int, mixed> $context = [] ][, Throwable|null $previous = null ]) : mixed
Parameters
- $message : string
- $errorCode : string
- $httpStatusCode : int = 400
- $context : array<string|int, mixed> = []
- $previous : Throwable|null = null
cannotDeleteSelf()
Cannot delete an own user account
public
static cannotDeleteSelf() : self
Return values
selfemptyFields()
Required fields are empty
public
static emptyFields() : self
Return values
selffailedToCreate()
Failed to create user
public
static failedToCreate() : self
Return values
selffailedToDelete()
Failed to delete user
public
static failedToDelete() : self
Return values
selfinvalidId()
Invalid or missing user ID
public
static invalidId() : self
Return values
selfnotFound()
User isn't found in database
public
static notFound(int $id) : self
Parameters
- $id : int
Return values
selfunauthorized()
User isn't authorized to perform this action
public
static unauthorized() : self
Return values
selfusernameTaken()
Username already exists
public
static usernameTaken() : self