API Models TypeDefinitionInterface - evansims/openfga-php GitHub Wiki
Represents a type definition in an OpenFGA authorization model. Type definitions are the building blocks of authorization models that define the types of objects in your system and the relationships that can exist between them. Each type definition specifies: - The type name (for example "document," "user," "organization") - The relations that objects of this type can have (for example "viewer," "editor," "owner") - Optional metadata for additional context and configuration Type definitions form the schema that OpenFGA uses to understand your permission model and validate authorization queries.
Table of Contents
OpenFGA\Models
ModelInterface
JsonSerializable
- TypeDefinition (implementation)
public function getMetadata(): MetadataInterface|null
Get the metadata associated with this type definition. Metadata provides additional context, documentation, and configuration information for the type definition. This can include source file information, module details, and other development-time context.
MetadataInterface
| null
— The metadata, or null if not specified
public function getRelations(): ?OpenFGA\Models\Collections\TypeDefinitionRelationsInterface
Get the collection of relations defined for this type. Relations define the authorized relationships that can exist between objects of this type and other entities in the system.
TypeDefinitionRelationsInterface
| null
public function getType(): string
Get the name of this type. The type name uniquely identifies this type definition within the authorization model. Common examples include "user," "document," "folder," "organization," etc.
string
— The unique type name
public function jsonSerialize(): array<string, mixed>
array<
string,
mixed>