TenantsController
extends PlatformAdminAppController
in package
Base controller for the isolated platform admin portal.
Table of Contents
Constants
- MOBILE_QUEUE_DEFAULT_PER_PAGE : int = 25
- MOBILE_QUEUE_MAX_PER_PAGE : int = 50
- VIEW_DATA_EVENT : string = 'KMP.plugins.callForViewData'
- VIEW_PLUGIN_EVENT : string = 'KMP.plugins.callForViewCells'
- MAX_LEGACY_IMPORT_BYTES : mixed = 512 * 1024 * 1024
- Upper bound for synchronous legacy .kmpbackup imports.
Properties
- $isCsvRequest : bool
- $platformAdmin : array<string, mixed>|null
- $pluginViewCells : array<string|int, mixed>
- $pluginViewCellsEnabledForFragment : bool
- Whether an intentionally fragment-style response still needs plugin view cells.
Methods
- add() : Response|null|void
- Create a tenant registry row and safe platform-managed configuration.
- archive() : mixed
- Archive a suspended or incomplete tenant after operator step-up verification.
- backups() : void
- Show tenant-scoped platform-admin backup controls.
- beforeFilter() : Response|null|void
- Enforce fail-closed portal feature flag and platform-admin session auth.
- beforeRender() : Response|null|void
- Finalize view-only data after the action has run.
- config() : Response|null|void
- View and edit safe tenant-scoped platform configuration.
- createBackup() : Response|null
- Queue an encrypted tenant JSON logical archive from Platform Admin.
- deleteBackup() : Response|null
- Delete an encrypted tenant backup object after audit and operator step-up.
- downloadBackup() : Response|null
- Download an encrypted tenant .kmpbackup archive after audit and step-up.
- downloadBackupRecoveryKey() : Response|null
- Download a backup-scoped recovery key after audit and operator step-up.
- edit() : Response|null|void
- Edit safe tenant registry fields and platform-managed configuration.
- importLegacyBackup() : Response|null
- Import a legacy passphrase-encrypted .kmpbackup archive as a managed backup.
- index() : void
- List platform tenants without database or secret metadata.
- initialize() : void
- Load shared components: Authentication, Authorization, Flash.
- isCsvRequest() : bool
- Check if current request is for CSV export.
- reactivate() : mixed
- Reactivate a suspended tenant after operator step-up verification.
- restoreBackup() : Response|null
- Queue a guarded tenant restore request.
- suspend() : mixed
- Suspend an active tenant after operator step-up verification.
- switchView() : Response
- Switch between mobile and desktop view modes.
- view() : void
- Show safe tenant registry details and recent operational status.
- appSettingImageDataUri() : string|null
- Resolve shared tenant branding for the online and cached mobile templates.
- assertDeletableBackup() : void
- Validate that a managed archive can be removed without interrupting active work.
- assertSafeContextUrl() : string
- Ensure URL is same-origin relative path + query only.
- assertUsableBackup() : void
- Validate completed encrypted backup metadata before a guarded action.
- authorizeCurrentUrl() : void
- Authorize the current URL/action via Authorization component.
- backupPolicyRetentionDays() : int
- Retention days from the global backup policy, with a safe fallback.
- buildGridDataUrlFromPageContext() : string
- Build grid-data URL preserving query string from page context.
- consumeFlashForStream() : array<string, mixed>
- Read flash from session and clear it for stream rendering.
- enablePluginViewCellsForFragment() : void
- Include route-matched plugin cells in an AJAX or other fragment response.
- exportPlatformBackupRecoveryKey() : array{filename: string, content: string}
- Export a platform database backup recovery-key package.
- exportTenantBackupRecoveryKey() : array{filename: string, content: string}
- Export a tenant backup recovery-key package.
- getPageContextUrl() : string|null
- Posted page context URL (path + query), validated.
- isGridOriginRequest() : bool
- Whether POST originated from a grid index (stay on list).
- isLocked() : bool
- Check whether a platform user lockout timestamp is still active.
- matchesGridIndexPath() : bool
- Whether page context path matches a grid index route pattern.
- mobileQueuePagination() : array<string, int|bool>
- Build shared pagination values for mobile actionable queues.
- mobileQueuePaginationPayload() : array<string, int|bool>
- Remove internal pagination values before sending the mobile JSON payload.
- organizeViewCells() : array<string|int, mixed>
- Organize view cells by type and display order.
- platform() : Connection
- Return the platform metadata connection.
- recoveryKeyDownloadResponse() : Response
- Return a recovery-key attachment that browsers and intermediary caches must not retain.
- renderDataverseTableRowElement() : string
- Render a single Dataverse grid row element (Turbo Stream replace target HTML).
- renderTurboCloseModal() : Response
- Render turbo-stream: flash + replace table frame with lazy reload src.
- renderTurboFlashOnly() : Response
- Render turbo-stream flash messages without forcing a grid or frame reload.
- renderTurboReloadFrame() : Response
- Stream that reloads an edit turbo-frame (validation errors).
- renderTurboRemoveGridRow() : Response
- Render turbo-stream: flash + remove a grid row (no longer matches current filters).
- renderTurboReplaceGridRow() : Response
- Render turbo-stream: flash + replace a single grid row by DOM id.
- stageBackupDownload() : array{path: string, filename: string}
- Stage and verify a backup for a streaming file response.
- statusIsAllowed() : bool
- Check whether a platform user status is allowed for authenticated access.
- validateStepUpAction() : string
- Validate typed confirmation, reason, and TOTP step-up for sensitive admin actions.
- wantsTurboStreamRequest() : bool
- Whether the client expects a turbo-stream response.
- withPageContextQuery() : T
- Run a callback with query params from the posted page context URL.
- assertValidIdentifier() : void
- Validate a PostgreSQL identifier used for tenant database resources.
- assertValidSlug() : void
- Validate platform tenant slug format.
- auditOptions() : array<string, mixed>
- auditService() : PlatformAuditService
- Create the platform audit service.
- auditTenantConfigChange() : void
- auditTenantRegistryChange() : void
- configFormData() : array<string, mixed>
- createTenant() : array<string, mixed>
- defaultTenantForm() : array<string, string>
- encodeConfig() : string
- enqueueTenantProvisioningJob() : array<string, mixed>
- Queue out-of-band full tenant provisioning.
- ensureTenantSecrets() : void
- Ensure runtime tenant routing can resolve the DB password secret after create.
- generateDatabasePassword() : string
- Generate a random URL-safe tenant database password.
- initialSuperUserEmailFromRequest() : string|null
- Validate and normalize the initial tenant super-user email.
- jobEnqueuer() : PlatformAdminJobEnqueuer
- Create the audited Platform Admin job enqueue service.
- jobEvents() : array<int, array<string, mixed>>
- latestTenantJob() : array<string, mixed>|null
- saveTenantConfig() : void
- tenantBackupById() : array<string, mixed>
- tenantBackups() : array<int, array<string, mixed>>
- tenantBackupService() : TenantBackupService
- Build the managed tenant backup service (same wiring as TenantBackupCommand).
- tenantBySlug() : array<string, mixed>|null
- tenantDataFromRequest() : array<string, mixed>
- tenantFormFromRow() : array<string, string>
- tenantHosts() : array<int, array<string, mixed>>
- tenantJobs() : array<int, array<string, mixed>>
- tenantMetricHours() : array<int, array<string, mixed>>
- tenantMetricRoutes() : array<int, array<string, mixed>>
- tenantMetrics() : array<string, int|float|bool>
- transitionLifecycle() : Response|null
- Apply a guarded tenant lifecycle transition.
- updateTenant() : void
- upsertPrimaryHost() : void
- Create or update the active primary host row for a tenant.
Constants
MOBILE_QUEUE_DEFAULT_PER_PAGE
public
int
MOBILE_QUEUE_DEFAULT_PER_PAGE
= 25
Shared default page size for mobile actionable queues.
MOBILE_QUEUE_MAX_PER_PAGE
public
int
MOBILE_QUEUE_MAX_PER_PAGE
= 50
Shared maximum page size for mobile actionable queues.
VIEW_DATA_EVENT
public
string
VIEW_DATA_EVENT
= 'KMP.plugins.callForViewData'
Event for plugin view data enhancement
VIEW_PLUGIN_EVENT
public
string
VIEW_PLUGIN_EVENT
= 'KMP.plugins.callForViewCells'
Event for plugin view cell registration
MAX_LEGACY_IMPORT_BYTES
Upper bound for synchronous legacy .kmpbackup imports.
private
mixed
MAX_LEGACY_IMPORT_BYTES
= 512 * 1024 * 1024
Properties
$isCsvRequest
protected
bool
$isCsvRequest
= false
Whether current request is for CSV export (.csv extension)
$platformAdmin
protected
array<string, mixed>|null
$platformAdmin
= null
Authenticated platform admin context.
$pluginViewCells
protected
array<string|int, mixed>
$pluginViewCells
= []
View cells from plugins for current request
$pluginViewCellsEnabledForFragment
Whether an intentionally fragment-style response still needs plugin view cells.
protected
bool
$pluginViewCellsEnabledForFragment
= false
Methods
add()
Create a tenant registry row and safe platform-managed configuration.
public
add() : Response|null|void
Return values
Response|null|voidarchive()
Archive a suspended or incomplete tenant after operator step-up verification.
public
archive(string $slug) : mixed
Parameters
- $slug : string
backups()
Show tenant-scoped platform-admin backup controls.
public
backups(string $slug) : void
Parameters
- $slug : string
-
Tenant slug
beforeFilter()
Enforce fail-closed portal feature flag and platform-admin session auth.
public
beforeFilter(EventInterface $event) : Response|null|void
Parameters
- $event : EventInterface
-
The beforeFilter event
Return values
Response|null|voidbeforeRender()
Finalize view-only data after the action has run.
public
beforeRender(EventInterface<string|int, Controller> $event) : Response|null|void
Deferring view cells prevents redirect-only requests from executing badge callbacks.
Parameters
- $event : EventInterface<string|int, Controller>
-
Event.
Return values
Response|null|voidconfig()
View and edit safe tenant-scoped platform configuration.
public
config(string $slug) : Response|null|void
Parameters
- $slug : string
-
Tenant slug
Return values
Response|null|voidcreateBackup()
Queue an encrypted tenant JSON logical archive from Platform Admin.
public
createBackup(string $slug) : Response|null
Parameters
- $slug : string
-
Tenant slug
Return values
Response|nulldeleteBackup()
Delete an encrypted tenant backup object after audit and operator step-up.
public
deleteBackup(string $slug, string $backupId) : Response|null
Parameters
- $slug : string
-
Tenant slug
- $backupId : string
-
Backup row id
Return values
Response|nulldownloadBackup()
Download an encrypted tenant .kmpbackup archive after audit and step-up.
public
downloadBackup(string $slug, string $backupId) : Response|null
Parameters
- $slug : string
-
Tenant slug
- $backupId : string
-
Backup row id
Return values
Response|nulldownloadBackupRecoveryKey()
Download a backup-scoped recovery key after audit and operator step-up.
public
downloadBackupRecoveryKey(string $slug, string $backupId) : Response|null
Parameters
- $slug : string
-
Tenant slug
- $backupId : string
-
Backup row id
Return values
Response|nulledit()
Edit safe tenant registry fields and platform-managed configuration.
public
edit(string $slug) : Response|null|void
Parameters
- $slug : string
-
Tenant slug
Return values
Response|null|voidimportLegacyBackup()
Import a legacy passphrase-encrypted .kmpbackup archive as a managed backup.
public
importLegacyBackup(string $slug) : Response|null
Accepts archives produced by the retired tenant self-service system and by upstream (ansteorra/KMP) installs. The archive is decrypted with the supplied passphrase, re-encrypted with the tenant's envelope keys, and recorded as a normal managed backup — restorable through the standard guarded restore flow.
Parameters
- $slug : string
-
Tenant slug
Return values
Response|nullindex()
List platform tenants without database or secret metadata.
public
index() : void
initialize()
Load shared components: Authentication, Authorization, Flash.
public
initialize() : void
isCsvRequest()
Check if current request is for CSV export.
public
isCsvRequest() : bool
Return values
boolreactivate()
Reactivate a suspended tenant after operator step-up verification.
public
reactivate(string $slug) : mixed
Parameters
- $slug : string
restoreBackup()
Queue a guarded tenant restore request.
public
restoreBackup(string $slug, string $backupId) : Response|null
Parameters
- $slug : string
-
Tenant slug
- $backupId : string
-
Backup row id
Return values
Response|nullsuspend()
Suspend an active tenant after operator step-up verification.
public
suspend(string $slug) : mixed
Parameters
- $slug : string
switchView()
Switch between mobile and desktop view modes.
public
switchView() : Response
Stores preference in session and redirects to appropriate interface. Mobile redirects to viewMobileCard, desktop to profile.
Return values
Response —Redirect response
view()
Show safe tenant registry details and recent operational status.
public
view(string $slug) : void
Parameters
- $slug : string
-
Tenant slug
appSettingImageDataUri()
Resolve shared tenant branding for the online and cached mobile templates.
protected
appSettingImageDataUri(string $settingName) : string|null
Parameters
- $settingName : string
Return values
string|nullassertDeletableBackup()
Validate that a managed archive can be removed without interrupting active work.
protected
assertDeletableBackup(array<string, mixed> $backup[, array<int, string> $allowedTypes = [TenantBackupService::BACKUP_TYPE, TenantBackupService::LEGACY_BACKUP_TYPE, 'pg_dump'] ]) : void
Parameters
- $backup : array<string, mixed>
- $allowedTypes : array<int, string> = [TenantBackupService::BACKUP_TYPE, TenantBackupService::LEGACY_BACKUP_TYPE, 'pg_dump']
assertSafeContextUrl()
Ensure URL is same-origin relative path + query only.
protected
assertSafeContextUrl(string $url) : string
Parameters
- $url : string
Tags
Return values
stringassertUsableBackup()
Validate completed encrypted backup metadata before a guarded action.
protected
assertUsableBackup(array<string, mixed> $backup[, array<int, string> $allowedTypes = [TenantBackupService::BACKUP_TYPE, 'pg_dump'] ]) : void
Parameters
- $backup : array<string, mixed>
- $allowedTypes : array<int, string> = [TenantBackupService::BACKUP_TYPE, 'pg_dump']
authorizeCurrentUrl()
Authorize the current URL/action via Authorization component.
protected
authorizeCurrentUrl() : void
Tags
backupPolicyRetentionDays()
Retention days from the global backup policy, with a safe fallback.
protected
backupPolicyRetentionDays() : int
Return values
intbuildGridDataUrlFromPageContext()
Build grid-data URL preserving query string from page context.
protected
buildGridDataUrlFromPageContext(string|null $pageContextUrl, array<string, mixed> $gridDataRoute) : string
Parameters
- $pageContextUrl : string|null
- $gridDataRoute : array<string, mixed>
-
Cake URL array for gridData action
Return values
stringconsumeFlashForStream()
Read flash from session and clear it for stream rendering.
protected
consumeFlashForStream() : array<string, mixed>
Return values
array<string, mixed>enablePluginViewCellsForFragment()
Include route-matched plugin cells in an AJAX or other fragment response.
protected
enablePluginViewCellsForFragment() : void
exportPlatformBackupRecoveryKey()
Export a platform database backup recovery-key package.
protected
exportPlatformBackupRecoveryKey(array<string, mixed> $backup) : array{filename: string, content: string}
Parameters
- $backup : array<string, mixed>
-
Backup metadata row
Return values
array{filename: string, content: string}exportTenantBackupRecoveryKey()
Export a tenant backup recovery-key package.
protected
exportTenantBackupRecoveryKey(array<string, mixed> $backup, array<string, mixed> $tenant) : array{filename: string, content: string}
Parameters
- $backup : array<string, mixed>
-
Backup metadata row
- $tenant : array<string, mixed>
-
Tenant metadata row
Return values
array{filename: string, content: string}getPageContextUrl()
Posted page context URL (path + query), validated.
protected
getPageContextUrl() : string|null
Return values
string|nullisGridOriginRequest()
Whether POST originated from a grid index (stay on list).
protected
isGridOriginRequest(string|null $pageContextUrl) : bool
Parameters
- $pageContextUrl : string|null
Return values
boolisLocked()
Check whether a platform user lockout timestamp is still active.
protected
isLocked(mixed $lockedUntil) : bool
Parameters
- $lockedUntil : mixed
Return values
boolmatchesGridIndexPath()
Whether page context path matches a grid index route pattern.
protected
matchesGridIndexPath(string|null $pageContextUrl, string $pathRegex) : bool
Parameters
- $pageContextUrl : string|null
- $pathRegex : string
Return values
boolmobileQueuePagination()
Build shared pagination values for mobile actionable queues.
protected
mobileQueuePagination(int $total) : array<string, int|bool>
Parameters
- $total : int
-
Total actionable records
Return values
array<string, int|bool>mobileQueuePaginationPayload()
Remove internal pagination values before sending the mobile JSON payload.
protected
mobileQueuePaginationPayload(array<string, int|bool> $pagination) : array<string, int|bool>
Parameters
- $pagination : array<string, int|bool>
-
Pagination data
Return values
array<string, int|bool>organizeViewCells()
Organize view cells by type and display order.
protected
organizeViewCells(array<string|int, mixed> $viewCells) : array<string|int, mixed>
Unused - view cells organized in ViewCellRegistry
Parameters
- $viewCells : array<string|int, mixed>
-
Flat array of view cell configurations
Return values
array<string|int, mixed> —Organized array grouped by type and sorted by order
platform()
Return the platform metadata connection.
protected
platform() : Connection
Return values
ConnectionrecoveryKeyDownloadResponse()
Return a recovery-key attachment that browsers and intermediary caches must not retain.
protected
recoveryKeyDownloadResponse(array{filename: string, content: string} $export) : Response
Parameters
- $export : array{filename: string, content: string}
-
Recovery-key export
Return values
ResponserenderDataverseTableRowElement()
Render a single Dataverse grid row element (Turbo Stream replace target HTML).
protected
renderDataverseTableRowElement(array<string, mixed> $vars) : string
Parameters
- $vars : array<string, mixed>
-
Element variables
Return values
stringrenderTurboCloseModal()
Render turbo-stream: flash + replace table frame with lazy reload src.
protected
renderTurboCloseModal(string $refreshFrame, array<string, mixed> $gridDataRoute[, string|null $pageContextUrl = null ][, array<string|int, mixed>|null $flashMessages = null ]) : Response
Parameters
- $refreshFrame : string
- $gridDataRoute : array<string, mixed>
- $pageContextUrl : string|null = null
- $flashMessages : array<string|int, mixed>|null = null
Return values
ResponserenderTurboFlashOnly()
Render turbo-stream flash messages without forcing a grid or frame reload.
protected
renderTurboFlashOnly([array<string|int, mixed>|null $flashMessages = null ]) : Response
Parameters
- $flashMessages : array<string|int, mixed>|null = null
Return values
ResponserenderTurboReloadFrame()
Stream that reloads an edit turbo-frame (validation errors).
protected
renderTurboReloadFrame(string $frameId, string $frameSrc[, array<string|int, mixed>|null $flashMessages = null ]) : Response
Parameters
- $frameId : string
- $frameSrc : string
- $flashMessages : array<string|int, mixed>|null = null
Return values
ResponserenderTurboRemoveGridRow()
Render turbo-stream: flash + remove a grid row (no longer matches current filters).
protected
renderTurboRemoveGridRow(string $rowDomId[, array<string|int, mixed>|null $flashMessages = null ]) : Response
Parameters
- $rowDomId : string
- $flashMessages : array<string|int, mixed>|null = null
Return values
ResponserenderTurboReplaceGridRow()
Render turbo-stream: flash + replace a single grid row by DOM id.
protected
renderTurboReplaceGridRow(string $rowDomId, string $rowHtml[, array<string|int, mixed>|null $flashMessages = null ]) : Response
Parameters
- $rowDomId : string
- $rowHtml : string
- $flashMessages : array<string|int, mixed>|null = null
Return values
ResponsestageBackupDownload()
Stage and verify a backup for a streaming file response.
protected
stageBackupDownload(array<string, mixed> $backup, BackupArchiveStorageInterface $storage, string $filenamePrefix) : array{path: string, filename: string}
Parameters
- $backup : array<string, mixed>
- $storage : BackupArchiveStorageInterface
- $filenamePrefix : string
Return values
array{path: string, filename: string}statusIsAllowed()
Check whether a platform user status is allowed for authenticated access.
protected
statusIsAllowed(string $status) : bool
Parameters
- $status : string
Return values
boolvalidateStepUpAction()
Validate typed confirmation, reason, and TOTP step-up for sensitive admin actions.
protected
validateStepUpAction(string $expectedConfirmation) : string
Parameters
- $expectedConfirmation : string
Return values
stringwantsTurboStreamRequest()
Whether the client expects a turbo-stream response.
protected
wantsTurboStreamRequest() : bool
Return values
boolwithPageContextQuery()
Run a callback with query params from the posted page context URL.
protected
withPageContextQuery(string|null $pageContextUrl, callable(): T $callback) : T
Parameters
- $pageContextUrl : string|null
- $callback : callable(): T
Tags
Return values
TassertValidIdentifier()
Validate a PostgreSQL identifier used for tenant database resources.
private
assertValidIdentifier(string $identifier, string $label) : void
Parameters
- $identifier : string
- $label : string
assertValidSlug()
Validate platform tenant slug format.
private
assertValidSlug(string $slug) : void
Parameters
- $slug : string
auditOptions()
private
auditOptions([string|null $tenantId = null ]) : array<string, mixed>
Parameters
- $tenantId : string|null = null
Return values
array<string, mixed>auditService()
Create the platform audit service.
private
auditService() : PlatformAuditService
Return values
PlatformAuditServiceauditTenantConfigChange()
private
auditTenantConfigChange(array<string, mixed> $tenant, array<string, mixed> $oldConfig, array<string, mixed> $newConfig) : void
Parameters
- $tenant : array<string, mixed>
-
Tenant row
- $oldConfig : array<string, mixed>
-
Previous safe config
- $newConfig : array<string, mixed>
-
New safe config
auditTenantRegistryChange()
private
auditTenantRegistryChange(string $action, array<string, mixed> $tenant, array<string, mixed> $oldConfig, array<string, mixed> $tenantData, array<string, mixed> $newConfig) : void
Parameters
- $action : string
- $tenant : array<string, mixed>
- $oldConfig : array<string, mixed>
- $tenantData : array<string, mixed>
- $newConfig : array<string, mixed>
configFormData()
private
configFormData(array<string, mixed> $data) : array<string, mixed>
Parameters
- $data : array<string, mixed>
Return values
array<string, mixed>createTenant()
private
createTenant(array<string, mixed> $tenantData, array<string, mixed> $config) : array<string, mixed>
Parameters
- $tenantData : array<string, mixed>
- $config : array<string, mixed>
Return values
array<string, mixed>defaultTenantForm()
private
defaultTenantForm() : array<string, string>
Return values
array<string, string>encodeConfig()
private
encodeConfig(array<string, mixed> $config) : string
Parameters
- $config : array<string, mixed>
Return values
stringenqueueTenantProvisioningJob()
Queue out-of-band full tenant provisioning.
private
enqueueTenantProvisioningJob(array<string, mixed> $tenant, array<string, mixed> $tenantData, array<string, mixed> $config, string $initialSuperUserEmail) : array<string, mixed>
Parameters
- $tenant : array<string, mixed>
- $tenantData : array<string, mixed>
- $config : array<string, mixed>
- $initialSuperUserEmail : string
Return values
array<string, mixed>ensureTenantSecrets()
Ensure runtime tenant routing can resolve the DB password secret after create.
private
ensureTenantSecrets(string $slug) : void
Parameters
- $slug : string
generateDatabasePassword()
Generate a random URL-safe tenant database password.
private
generateDatabasePassword() : string
Return values
stringinitialSuperUserEmailFromRequest()
Validate and normalize the initial tenant super-user email.
private
initialSuperUserEmailFromRequest(array<string, mixed> $data, bool $required) : string|null
Parameters
- $data : array<string, mixed>
-
Request data
- $required : bool
Return values
string|nulljobEnqueuer()
Create the audited Platform Admin job enqueue service.
private
jobEnqueuer() : PlatformAdminJobEnqueuer
Return values
PlatformAdminJobEnqueuerjobEvents()
private
jobEvents(string $jobId) : array<int, array<string, mixed>>
Parameters
- $jobId : string
Return values
array<int, array<string, mixed>>latestTenantJob()
private
latestTenantJob(string $tenantId, string $jobType) : array<string, mixed>|null
Parameters
- $tenantId : string
- $jobType : string
Return values
array<string, mixed>|nullsaveTenantConfig()
private
saveTenantConfig(array<string, mixed> $tenant, array<string, mixed> $oldConfig, array<string, mixed> $newConfig) : void
Parameters
- $tenant : array<string, mixed>
-
Tenant row
- $oldConfig : array<string, mixed>
-
Previous safe config
- $newConfig : array<string, mixed>
-
New safe config
tenantBackupById()
private
tenantBackupById(string $tenantId, string $backupId) : array<string, mixed>
Parameters
- $tenantId : string
- $backupId : string
Return values
array<string, mixed>tenantBackups()
private
tenantBackups(string $tenantId) : array<int, array<string, mixed>>
Parameters
- $tenantId : string
Return values
array<int, array<string, mixed>>tenantBackupService()
Build the managed tenant backup service (same wiring as TenantBackupCommand).
private
tenantBackupService() : TenantBackupService
Return values
TenantBackupServicetenantBySlug()
private
tenantBySlug(string $slug) : array<string, mixed>|null
Parameters
- $slug : string
Return values
array<string, mixed>|nulltenantDataFromRequest()
private
tenantDataFromRequest(array<string, mixed> $data[, string|null $existingSlug = null ][, string|null $currentStatus = null ]) : array<string, mixed>
Parameters
- $data : array<string, mixed>
- $existingSlug : string|null = null
- $currentStatus : string|null = null
Return values
array<string, mixed>tenantFormFromRow()
private
tenantFormFromRow(array<string, mixed> $tenant) : array<string, string>
Parameters
- $tenant : array<string, mixed>
Return values
array<string, string>tenantHosts()
private
tenantHosts(string $tenantId) : array<int, array<string, mixed>>
Parameters
- $tenantId : string
Return values
array<int, array<string, mixed>>tenantJobs()
private
tenantJobs(string $tenantId) : array<int, array<string, mixed>>
Parameters
- $tenantId : string
Return values
array<int, array<string, mixed>>tenantMetricHours()
private
tenantMetricHours(string $tenantId) : array<int, array<string, mixed>>
Parameters
- $tenantId : string
Return values
array<int, array<string, mixed>>tenantMetricRoutes()
private
tenantMetricRoutes(string $tenantId) : array<int, array<string, mixed>>
Parameters
- $tenantId : string
Return values
array<int, array<string, mixed>>tenantMetrics()
private
tenantMetrics(string $tenantId) : array<string, int|float|bool>
Parameters
- $tenantId : string
Return values
array<string, int|float|bool>transitionLifecycle()
Apply a guarded tenant lifecycle transition.
private
transitionLifecycle(string $slug, string $targetStatus, string $confirmationVerb) : Response|null
Parameters
- $slug : string
- $targetStatus : string
- $confirmationVerb : string
Return values
Response|nullupdateTenant()
private
updateTenant(array<string, mixed> $tenant, array<string, mixed> $tenantData, array<string, mixed> $oldConfig, array<string, mixed> $newConfig) : void
Parameters
- $tenant : array<string, mixed>
- $tenantData : array<string, mixed>
- $oldConfig : array<string, mixed>
- $newConfig : array<string, mixed>
upsertPrimaryHost()
Create or update the active primary host row for a tenant.
private
upsertPrimaryHost(string $tenantId, string $host, string $now) : void
Parameters
- $tenantId : string
- $host : string
- $now : string