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(): ?stringGet the fully qualified class name for object types.
string | null
public function getDefault(): mixedGet the default value to use when property is missing.
mixed — Default value for optional properties
public function getEnum(): ?arrayGet the array of allowed values for enumeration validation.
array | null — Array of allowed values or null if not an enumeration
public function getFormat(): ?stringGet the additional format constraint for this property.
string | null — Format constraint (for example 'date', 'datetime') or null if none
public function getItems(): ?arrayGet the type specification for array items.
array | null
public function getName(): stringGet the property name as it appears in the data.
string — The property name
public function getParameterName(): ?stringGet the alternative parameter name for constructor mapping.
string | null — Alternative parameter name or null if using default mapping
public function getType(): stringGet the data type for this property.
string — The data type (string, integer, boolean, array, object, etc.)
public function isRequired(): boolCheck if this property is required for validation.
bool — True if the property is required, false otherwise