Oihana PHP System

SchemaTrait

Provides methods for initialize a 'schema' property.

Tags
author

Marc Alcaraz (ekameleon)

since
1.0.0

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|null

hasSchema()

Check if schema is defined (either as string or callable).

public hasSchema() : bool
Return values
bool

initializeSchema()

Initialize the 'schema' property.

public initializeSchema([array<string|int, mixed> $init = [] ]) : static
Parameters
$init : array<string|int, mixed> = []
Return values
static

        
On this page

Search results