API Models Node - evansims/openfga-php GitHub Wiki

Represents a node in the authorization evaluation tree structure. When OpenFGA evaluates complex authorization rules, it builds a tree of nodes representing different evaluation paths. Each node can contain unions, intersections, differences, or leaf computations that contribute to the final authorization decision. This is the fundamental building block for representing how authorization decisions are computed and provides insight into the evaluation process.

Table of Contents


Namespace

OpenFGA\Models


Source

View source code


Implements


Related Classes


Constants

Name Value Description
OPENAPI_MODEL Node


Methods

getDifference

public function getDifference(): ?OpenFGA\Models\UsersetTreeDifferenceInterface

Get the difference operation for this node. The difference operation represents a set subtraction where users from one set are excluded from another set.

View source


Returns

UsersetTreeDifferenceInterface | null


getIntersection

public function getIntersection(): ?OpenFGA\Models\NodeInterface|OpenFGA\Models\NodeUnionInterface|null

Get the intersection operation for this node. The intersection operation represents the common elements between multiple usersets in the authorization tree.

View source


Returns

NodeInterface | null | NodeUnionInterface | null — The intersection node or null if not applicable


getLeaf

public function getLeaf(): ?OpenFGA\Models\LeafInterface

Get the leaf node if this is a terminal node. Leaf nodes represent the actual users, computed usersets, or tuple-to-userset relationships at the end of the evaluation tree.

View source


Returns

LeafInterface | null


getName

public function getName(): string

Get the name identifier for this node. The name is used to identify the node within the authorization model and corresponds to relation names or other identifiers.

View source


Returns

string — The node name


getUnion

public function getUnion(): ?OpenFGA\Models\NodeInterface|OpenFGA\Models\NodeUnionInterface|null

Get the union operation for this node. The union operation represents the combination of multiple usersets where users from any of the sets are included in the result.

View source


Returns

NodeInterface | null | NodeUnionInterface | null — The union node or null if not applicable


jsonSerialize

public function jsonSerialize(): array

Serialize the node to its JSON representation.

View source


Returns

array — The serialized node data


schema

Implements Models\NodeInterface

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.

View source


Returns

SchemaInterface — The schema definition containing validation rules and property specifications for this model

⚠️ **GitHub.com Fallback** ⚠️