Tenant
in package
implements
JsonSerializable
A tenant is an isolated context within an organization. Each tenant has its own set of users, roles, permissions, resources, certificates, and configuration. Tenants can represent environments (dev/staging/prod) or separate business contexts.
Table of Contents
Interfaces
- JsonSerializable
Properties
- $createdAt : string
- $id : string
- $kind : TenantKind|null
- $metadata : mixed
- $name : string
- $organizationId : string
- $slug : string
- $status : TenantStatus
- $updatedAt : string
Methods
- __construct() : mixed
- Constructs a Tenant.
- fromArray() : self
- Rebuilds a Tenant from one decoded JSON object.
- jsonSerialize() : array<string, mixed>
- Renders this object for `json_encode()`.
- toArray() : array<string, mixed>
- Renders this object back to its wire form.
Properties
$createdAt read-only
public
string
$createdAt
$id read-only
public
string
$id
$kind read-only
public
TenantKind|null
$kind
= null
$metadata read-only
public
mixed
$metadata
$name read-only
public
string
$name
$organizationId read-only
public
string
$organizationId
$slug read-only
public
string
$slug
$status read-only
public
TenantStatus
$status
$updatedAt read-only
public
string
$updatedAt
Methods
__construct()
Constructs a Tenant.
public
__construct(string $createdAt, string $id, mixed $metadata, string $name, string $organizationId, string $slug, TenantStatus $status, string $updatedAt[, TenantKind|null $kind = null ]) : mixed
Parameters
- $createdAt : string
-
the server's
created_atfield - $id : string
-
the server's
idfield - $metadata : mixed
-
Arbitrary key-value metadata.
- $name : string
-
Human-readable name.
- $organizationId : string
-
The organization this tenant belongs to.
- $slug : string
-
URL-safe unique identifier within the organization (e.g.,
production). - $status : TenantStatus
-
Lifecycle status. New tenants default to [
TenantStatus::Active]. - $updatedAt : string
-
the server's
updated_atfield - $kind : TenantKind|null = null
-
Whether this is an ordinary tenant or the organization's own scope.
#[serde(default)]so every row written before organization scope existed reads back as [TenantKind::Standard], which is what it is. (optional)
fromArray()
Rebuilds a Tenant from one decoded JSON object.
public
static fromArray(array<string, mixed> $data) : self
Parameters
- $data : array<string, mixed>
-
The raw wire object.
Return values
selfjsonSerialize()
Renders this object for `json_encode()`.
public
jsonSerialize() : array<string, mixed>
Any Sensitive it carries stays WRAPPED here, so a log line or a
json_encode($model) in application code prints [SENSITIVE]. The one place a secret
is revealed is ManagementTransport, on the way to the wire
and nowhere else (§27.5).
Return values
array<string, mixed>toArray()
Renders this object back to its wire form.
public
toArray() : array<string, mixed>
§27.4 rule 5: a null property is OMITTED, not emitted as null. On a sparse update those two say opposite things — "leave this alone" versus "set this to nothing" — and only omission means the first.