-
Notifications
You must be signed in to change notification settings - Fork 5
API Models RelationReferenceInterface
Defines the contract for relation references with optional conditions. A relation reference specifies a particular relation within a type definition, optionally with an associated condition that must be satisfied. This allows for conditional access patterns where relationships are only valid when certain runtime conditions are met. Use this when you need to reference specific relations in your authorization model, especially when implementing attribute-based access control (ABAC) patterns.
Table of Contents
OpenFGA\Models
ModelInterfaceJsonSerializable
- RelationReference (implementation)
public function getCondition(): string|nullGet the optional condition name that must be satisfied. When specified, this condition must evaluate to true for the relation reference to be valid. This enables conditional access based on runtime context and attributes.
string | null — The condition name, or null if no condition is required
public function getRelation(): string|nullGet the optional specific relation on the referenced type. When specified, this limits the reference to a specific relation on the target type rather than the entire type. This allows for more precise relationship definitions.
string | null — The relation name, or null to reference the entire type
public function getType(): stringGet the type being referenced. This is the object type that this reference points to. It defines which type of objects can be used in relationships through this reference.
string — The type name being referenced
public function getWildcard(): object|nullGet the optional wildcard marker for type-level permissions. When present, this indicates that the reference applies to all instances of the specified type, rather than specific instances. This is useful for granting permissions at the type level.
object | null — The wildcard marker, or null for instance-specific references
public function jsonSerialize(): arrayarray
Getting Started: Introduction • Installation • Authentication
Essentials: Stores • Authorization Models • Relationship Tuples • Permissions Queries
Features: Helper Functions • Concurrency • Results • Exceptions • Observability • Integration
- API Reference - Full class and method documentation
- Quickstart - Get up and running in minutes
- Helpers - Convenient shortcuts for common operations
- Testing Guide - Unit testing with the SDK
- Performance Guide - Optimize for high-scale applications
- Report Issues - Bug reports and feature requests
- Discussions - Community support and questions
- Contributing - Help improve the SDK
- Changelog - Latest updates and releases
- OpenFGA Documentation - Official OpenFGA documentation
- OpenFGA Playground - Interactive modeling environment
- Authorization Concepts - Learn relationship-based access control
- Other SDKs - JavaScript, Go, Python, .NET, and more
OpenFGA PHP SDK • Apache 2.0 License
- Authorization Stores
- Authorization Models
- Relationship Tuples
- Permission Queries
- Testing with Assertions
- Helper Functions
- Concurrency
- Error Handling
- Framework Integration
- OpenTelemetry Observability
- Result Pattern
- Event Dispatcher
- HTTP Request Sent Event
- HTTP Response Received Event
- Operation Started Event
- Operation Completed Event
- More Events …
- Authentication Exception
- Client Exception
- Configuration Exception
- Network Exception
- Serialization Exception
- More Exceptions …
- Request Manager
- Request Context
- Circuit Breaker
- Parallel Task Executor
- Fiber Concurrent Executor
- Simple Concurrent Executor
- Retry Handler
- Exponential Backoff Retry Strategy
- More Networking …