InvitationsModelTrait
Standalone trait for the `invitations` Documents model dependency.
Used by middlewares / controllers / commands that need to read or update invitation records (user invite flow, password-set acceptance, email-change confirmation, post-callback finalization, etc.).
Tags
Table of Contents
Constants
- INVITATIONS_MODEL : string = 'invitationsModel'
- Initialization key for the invitations Documents model.
Properties
- $invitationsModel : Documents|null
- The invitations Documents model.
Methods
- cancelPendingInvitations() : void
- Soft-cancels every pending invitation targeting the given user.
- initializeInvitationsModel() : static
- Initializes the invitations model dependency from the $init array.
Constants
INVITATIONS_MODEL
Initialization key for the invitations Documents model.
public
string
INVITATIONS_MODEL
= 'invitationsModel'
Properties
$invitationsModel
The invitations Documents model.
protected
Documents|null
$invitationsModel
= null
Methods
cancelPendingInvitations()
Soft-cancels every pending invitation targeting the given user.
protected
cancelPendingInvitations(string $userKey[, bool $loggable = true ]) : void
Runs as part of the user deletion cascade: the invitation document
is kept for audit with actionStatus = cancelled and a fresh
modified timestamp.
Failures are logged but swallowed — a broken invitation update must never prevent the core user deletion from proceeding.
Parameters
- $userKey : string
- $loggable : bool = true
Tags
initializeInvitationsModel()
Initializes the invitations model dependency from the $init array.
protected
initializeInvitationsModel(array<string|int, mixed> $init, Container|null $container) : static
Parameters
- $init : array<string|int, mixed>
-
The initialization array.
- $container : Container|null
-
The DI container.