SchemaTrait
Provides methods for initialize a 'schema' property.
Tags
Table of Contents
Properties
- $schema : null|string|Closure|SchemaResolver
- The internal schema to use to hydrate the resources.
Methods
- getSchema() : string|null
- Get the resolved schema value.
- hasSchema() : bool
- Check if schema is defined (either as string or callable).
- initializeSchema() : static
- Initialize the 'schema' property.
Properties
$schema
The internal schema to use to hydrate the resources.
public
null|string|Closure|SchemaResolver
$schema
= null
Methods
getSchema()
Get the resolved schema value.
public
getSchema([mixed $target = null ]) : string|null
Parameters
- $target : mixed = null
-
Optional target to pass if the schema is invokable (like SchemaResolver)
Return values
string|nullhasSchema()
Check if schema is defined (either as string or callable).
public
hasSchema() : bool
Return values
boolinitializeSchema()
Initialize the 'schema' property.
public
initializeSchema([array<string|int, mixed> $init = [] ]) : static
Parameters
- $init : array<string|int, mixed> = []