API Models ObjectRelation - evansims/openfga-php GitHub Wiki
Represents a reference to a specific relation on an object. In authorization models, you often need to reference relationships between objects. An ObjectRelation identifies both the target object and the specific relation you're interested in, like "the owner of document:budget" or "editors of folder:reports." This is commonly used in authorization rules where permissions depend on relationships with other objects in your system.
Table of Contents
OpenFGA\Models
ObjectRelationInterface
JsonSerializable
ModelInterface
- ObjectRelationInterface (interface)
Name | Value | Description |
---|---|---|
OPENAPI_MODEL |
ObjectRelation |
public function getObject(): ?string
Get the object identifier in an object-relation pair. The object represents the resource or entity being referenced, typically formatted as "type:id" where type describes the kind of resource.
string
| null
public function getRelation(): string
Get the relation name that defines the type of relationship to the object. The relation describes what kind of permission or relationship exists. Common examples include "owner," "viewer," "editor," "member."
string
— The non-empty relation name
public function jsonSerialize(): array
array
Implements Models\ObjectRelationInterface
public function schema(): SchemaInterface
Get the schema definition for this model. This method returns the schema that defines the structure, validation rules, and serialization behavior for this model class. The schema is used for data validation, transformation, and ensuring consistency across API operations with the OpenFGA service. Each model's schema defines: - Required and optional properties - Data types and format constraints - Nested object relationships - Validation rules and business logic constraints The schema system enables the SDK to automatically validate incoming data, transform between different representations, and ensure compliance with the OpenFGA API specification.
SchemaInterface
— The schema definition containing validation rules and property specifications for this model