Documentation

Schema extends AbstractSchemaItem

Class that represents a JSON schema document

Table of Contents

$additionalProperties  : null|Property
If set, this determines the template that all additional (i.e. undefined) properties must adhere to
$links  : array<string|int, mixed>
$name  : string
$properties  : array<string|int, mixed>
decideOperationType()  : string
Based on this schema, decide the most appropriate operation type for a given property
factory()  : Schema
getAdditionalProperties()  : bool|Property
getLinks()  : array<string|int, mixed>
getName()  : string
getProperties()  : array<string|int, mixed>
getProperty()  : null|Property
Retrieve a property
propertyExists()  : bool
Check whether a property exists
setAdditionalProperties()  : mixed
setLinks()  : mixed
setName()  : mixed
setProperties()  : mixed
validateAdditionalProperty()  : bool|Property
Check whether an additional property is allowed and its type is valid
stockProperty()  : mixed
Stock a schema property only if set

Properties

$additionalProperties

If set, this determines the template that all additional (i.e. undefined) properties must adhere to

protected null|Property $additionalProperties
protected array<string|int, mixed> $links

Links for this schema

$name

protected string $name

Name of schema

$properties

protected array<string|int, mixed> $properties

Properties that this schema possesses

Methods

decideOperationType()

Based on this schema, decide the most appropriate operation type for a given property

public decideOperationType(Property $property) : string
Parameters
$property : Property

The property being performed on

Return values
string

factory()

public static factory(array<string|int, mixed> $data) : Schema
Parameters
$data : array<string|int, mixed>
Return values
Schema
public getLinks() : array<string|int, mixed>
Return values
array<string|int, mixed>

getName()

public getName() : string
Return values
string

getProperties()

public getProperties() : array<string|int, mixed>
Return values
array<string|int, mixed>

getProperty()

Retrieve a property

public getProperty( $property) : null|Property
Parameters
$property :

The name of the property

Return values
null|Property

propertyExists()

Check whether a property exists

public propertyExists( $property) : bool
Parameters
$property :

The name of the property

Return values
bool

setAdditionalProperties()

public setAdditionalProperties(array<string|int, mixed> $properties) : mixed
Parameters
$properties : array<string|int, mixed>
Return values
mixed
public setLinks(array<string|int, mixed> $links) : mixed
Parameters
$links : array<string|int, mixed>
Return values
mixed

setName()

public setName(string $name) : mixed
Parameters
$name : string
Return values
mixed

setProperties()

public setProperties(array<string|int, mixed> $properties) : mixed
Parameters
$properties : array<string|int, mixed>
Return values
mixed

validateAdditionalProperty()

Check whether an additional property is allowed and its type is valid

public validateAdditionalProperty( $value) : bool|Property
Parameters
$value :

The value trying to be set

Return values
bool|Property

stockProperty()

Stock a schema property only if set

protected static stockProperty(array<string|int, mixed> $data,  $property) : mixed
Parameters
$data : array<string|int, mixed>
$property :
Return values
mixed

Search results