API Models NodeInterface - evansims/openfga-php GitHub Wiki

Represents a node in a userset tree structure. Nodes are fundamental building blocks in OpenFGA's authorization model that represent different types of relationships and operations within the access control evaluation tree.

Table of Contents


Namespace

OpenFGA\Models


Source

View source code


Implements


Related Classes

  • Node (implementation)


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(): NodeUnionInterface|self|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

NodeUnionInterface | self | 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(): NodeUnionInterface|self|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

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


jsonSerialize

public function jsonSerialize(): array<string, mixed>

Serialize the node to its JSON representation.

View source


Returns

array&lt;string, mixed&gt; — The serialized node data

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