MemberVerification

Reference for the MemberVerification module: record and read immutable verification results linking a member to a row of some other module's table. Verifications are append-only; the latest record by id wins. Any module registers its own verification types up front, then saves outcomes and reads back status, counts and timestamps.

This page is a pure reference. For how the framework fits together, see the Guide.

Classes

MemberVerificationDatabase

Save and read verification records. Records are immutable: every save inserts a new row, and reads take the latest by id. Provides single lookups, bulk lookups keyed by entity or member id, counts, the latest verified timestamp, and filtered paged lists.

fromRow

MemberVerificationDatabase::fromRow(stdClass $row): MemberVerificationData

Convert a database row into a MemberVerificationData object.

NameTypeDescription
$rowstdClassA row from the member_verification table.

Returns MemberVerificationData The record.

GetById

MemberVerificationDatabase::GetById(int $verificationId): MemberVerificationData

Get a verification record by its id.

NameTypeDescription
$verificationIdintThe verification record id.

Returns MemberVerificationData The record.

GetCountsByEntityIDs

MemberVerificationDatabase::GetCountsByEntityIDs(string $moduleName, string $verificationName, string $tableName, array $tableRowIds): array

Count verification records for many entity ids at once, for a given verification type and table.

NameTypeDescription
$moduleNamestringThe module that registered the verification type.
$verificationNamestringThe verification type name.
$tableNamestringThe entity table name.
$tableRowIdsarrayThe entity row ids to count for.

Returns array A map of table row id to count.

GetOptionalVerifiedTimestamp

MemberVerificationDatabase::GetOptionalVerifiedTimestamp(string $moduleName, string $verificationName, int $tableRowId): CalendarDateTimeData|null

The timestamp of the latest verified record for an entity, or null if it was never verified.

NameTypeDescription
$moduleNamestringThe module that registered the verification type.
$verificationNamestringThe verification type name.
$tableRowIdintThe entity row id.

Returns CalendarDateTimeData|null The latest verified timestamp, or null.

GetOverallStatusesByMemberIDs

MemberVerificationDatabase::GetOverallStatusesByMemberIDs(array $memberIds): array

The latest overall verification status for many members at once, where null means no record, true means verified and false means unverified.

NameTypeDescription
$memberIdsarrayThe member ids to look up.

Returns array A map of member id to true, false or null.

GetStatusesByEntityIDs

MemberVerificationDatabase::GetStatusesByEntityIDs(string $moduleName, string $verificationName, string $tableName, array $tableRowIds): array

The latest verified status for many entity ids at once, for a given verification type and table.

NameTypeDescription
$moduleNamestringThe module that registered the verification type.
$verificationNamestringThe verification type name.
$tableNamestringThe entity table name.
$tableRowIdsarrayThe entity row ids to look up.

Returns array A map of table row id to verified boolean.

IsVerified

MemberVerificationDatabase::IsVerified(int $memberId, string $moduleName, string $verificationName, int $tableRowId): bool

Whether the latest record for a member, verification type and entity is verified. Returns false when no record exists.

NameTypeDescription
$memberIdintThe member id.
$moduleNamestringThe module that registered the verification type.
$verificationNamestringThe verification type name.
$tableRowIdintThe entity row id.

Returns bool True when the latest record is verified.

ListFiltered

MemberVerificationDatabase::ListFiltered(int $memberId, string $moduleName, string $verificationName, int $tableRowId, int $page, int $perPage): array

List verification records with optional filtering and pagination. Pass 0 for an id filter or an empty string for a name filter to skip it.

NameTypeDescription
$memberIdintFilter by member id, or 0 for no filter.
$moduleNamestringFilter by module name, or empty for no filter.
$verificationNamestringFilter by verification name, or empty for no filter.
$tableRowIdintFilter by entity row id, or 0 for no filter.
$pageintThe page number, starting at 1.
$perPageintThe number of rows per page.

Returns array A map with rows (an array of MemberVerificationData) and total (the match count).

Save

MemberVerificationDatabase::Save(int $memberId, string $moduleName, string $verificationName, string $tableName, int $tableRowId, bool $verified, string|null $optionalNote = null): int

Save a new verification record. Always inserts a new row, since records are immutable. Returns the new record id.

NameTypeDescription
$memberIdintThe member the verification is for.
$moduleNamestringThe module that registered the verification type.
$verificationNamestringThe verification type name.
$tableNamestringThe entity table name.
$tableRowIdintThe entity row id.
$verifiedboolThe verification outcome.
$optionalNotestring|nullAn optional note, or null.

Returns int The new verification record id.

MemberVerificationConfig

Register the verification types a module supports, then look them up by module and name or by table name. Each type binds a display name, an entity table and its id column.

Get

MemberVerificationConfig::Get(string $moduleName, string $verificationName): MemberVerificationTypeData

Get a registered verification type by module and name. Throws when the type is unknown.

NameTypeDescription
$moduleNamestringThe module that registered the type.
$verificationNamestringThe verification type name.

Returns MemberVerificationTypeData The registered type.

GetAll

MemberVerificationConfig::GetAll(): array

Every registered verification type, keyed by module and name.

Returns array A map of key to MemberVerificationTypeData.

GetByTableName

MemberVerificationConfig::GetByTableName(string $tableName): array

Every registered verification type whose table name matches the given one.

NameTypeDescription
$tableNamestringThe entity table name to filter by.

Returns array A map of key to MemberVerificationTypeData.

Register

MemberVerificationConfig::Register(string $moduleName, string $verificationName, string $displayName, string $tableName, string $idColumn): void

Register a verification type for a module, binding a display name, an entity table and its id column.

NameTypeDescription
$moduleNamestringThe module registering the type.
$verificationNamestringThe verification type name.
$displayNamestringThe human-readable name.
$tableNamestringThe entity table name.
$idColumnstringThe entity id column name.

Returns void

MemberVerificationData

Immutable data for one verification record. Fields and constructor only.

Properties

PropertyTypeDescription
$verification->idintThe record id (readonly).
$verification->memberIdintThe member the record is for (readonly).
$verification->moduleNamestringThe module that registered the type (readonly).
$verification->verificationNamestringThe verification type name (readonly).
$verification->tableNamestringThe entity table name (readonly).
$verification->tableRowIdintThe entity row id (readonly).
$verification->verifiedboolThe verification outcome (readonly).
$verification->optionalNotestring|nullAn optional note, or null (readonly).
$verification->addedTimestampCalendarDateTimeDataWhen the record was added (readonly).
$verification->addedDatestringThe date the record was added (readonly).

__construct

new MemberVerificationData(int $id = 0, int $memberId = 0, string $moduleName = '', string $verificationName = '', string $tableName = '', int $tableRowId = 0, bool $verified = false, string|null $optionalNote = null, CalendarDateTimeData $addedTimestamp = new CalendarDateTimeData(), string $addedDate = '')

Create a verification record data object.

NameTypeDescription
$idintThe record id.
$memberIdintThe member the record is for.
$moduleNamestringThe module that registered the type.
$verificationNamestringThe verification type name.
$tableNamestringThe entity table name.
$tableRowIdintThe entity row id.
$verifiedboolThe verification outcome.
$optionalNotestring|nullAn optional note, or null.
$addedTimestampCalendarDateTimeDataWhen the record was added.
$addedDatestringThe date the record was added.

Returns MemberVerificationData

MemberVerificationTypeData

Immutable data for a registered verification type. Fields and constructor only.

Properties

PropertyTypeDescription
$type->moduleNamestringThe module that registered the type (readonly).
$type->verificationNamestringThe verification type name (readonly).
$type->displayNamestringThe human-readable name (readonly).
$type->tableNamestringThe entity table name (readonly).
$type->idColumnstringThe entity id column name (readonly).

__construct

new MemberVerificationTypeData(string $moduleName = '', string $verificationName = '', string $displayName = '', string $tableName = '', string $idColumn = '')

Create a verification type data object.

NameTypeDescription
$moduleNamestringThe module that registered the type.
$verificationNamestringThe verification type name.
$displayNamestringThe human-readable name.
$tableNamestringThe entity table name.
$idColumnstringThe entity id column name.

Returns MemberVerificationTypeData

VerificationSummaryData

Immutable status summary for display. Fields and constructor only.

Properties

PropertyTypeDescription
$summary->statusTypestringThe status type (readonly).
$summary->statusMessagestringThe status message (readonly).
$summary->shortTextstringA short summary text (readonly).

__construct

new VerificationSummaryData(string $statusType = 'info', string $statusMessage = '', string $shortText = '')

Create a verification status summary data object.

NameTypeDescription
$statusTypestringThe status type.
$statusMessagestringThe status message.
$shortTextstringA short summary text.

Returns VerificationSummaryData