API Schemas SchemaProperty - evansims/openfga-php GitHub Wiki
Represents a single property definition within a schema. This class defines the validation rules, type information, and metadata for individual properties of OpenFGA model objects. Each property specifies how a field should be validated, transformed, and mapped during object creation. Properties support various data types including primitives (string, int, bool), complex objects, arrays, and collections, with optional validation constraints such as required status, default values, format restrictions, and enumeration limits.
Table of Contents
OpenFGA\Schemas
- SchemaPropertyInterface (interface)
public function getClassName(): ?string
Get the fully qualified class name for object types.
string
| null
public function getDefault(): mixed
Get the default value to use when property is missing.
mixed
— Default value for optional properties
public function getEnum(): ?array
Get the array of allowed values for enumeration validation.
array
| null
— Array of allowed values or null if not an enumeration
public function getFormat(): ?string
Get the additional format constraint for this property.
string
| null
— Format constraint (for example 'date', 'datetime') or null if none
public function getItems(): ?array
Get the type specification for array items.
array
| null
public function getName(): string
Get the property name as it appears in the data.
string
— The property name
public function getParameterName(): ?string
Get the alternative parameter name for constructor mapping.
string
| null
— Alternative parameter name or null if using default mapping
public function getType(): string
Get the data type for this property.
string
— The data type (string, integer, boolean, array, object, etc.)
public function isRequired(): bool
Check if this property is required for validation.
bool
— True if the property is required, false otherwise