Property
extends AbstractSchemaItem
in package
Class that represents an individual property in a JSON schema
Table of Contents
- DELIMETER = '#'
- $description : string
- $enum : array<string|int, mixed>
- $items : array<string|int, mixed>
- $name : string
- $pattern : string
- $type : string
- $value : mixed
- factory() : Property
- getDescription() : string
- getEnum() : array<string|int, mixed>
- getItems() : array<string|int, mixed>
- getName() : string
- getPath() : string
- Get the JSON pointer for this property
- getPattern() : string
- getType() : string
- getValue() : mixed
- setDescription() : mixed
- setEnum() : mixed
- setItems() : mixed
- setName() : mixed
- setPattern() : mixed
- setType() : mixed
- setValue() : mixed
- validate() : bool
- Validate the current value and ensure that it adheres to correct formatting, etc.
- preparePattern() : string
- Prepare the given pattern for Regex functions
- stockProperty() : mixed
- Stock a schema property only if set
Constants
DELIMETER
public
mixed
DELIMETER
= '#'
Properties
$description
protected
string
$description
Description of property
$enum
protected
array<string|int, mixed>
$enum
Enumerated types that values must adhere to
$items
protected
array<string|int, mixed>
$items
Array items that this property may possess
$name
protected
string
$name
Name of property
$pattern
protected
string
$pattern
Regex pattern that values must adhere to
$type
protected
string
$type
Type of property (e.g. string, array)
$value
protected
mixed
$value
This property's value
Methods
factory()
public
static factory([array<string|int, mixed> $data = array() ]) : Property
Parameters
- $data : array<string|int, mixed> = array()
Return values
Property —getDescription()
public
getDescription() : string
Return values
string —getEnum()
public
getEnum() : array<string|int, mixed>
Return values
array<string|int, mixed> —getItems()
public
getItems() : array<string|int, mixed>
Return values
array<string|int, mixed> —getName()
public
getName() : string
Return values
string —getPath()
Get the JSON pointer for this property
public
getPath() : string
Return values
string —getPattern()
public
getPattern() : string
Return values
string —getType()
public
getType() : string
Return values
string —getValue()
public
getValue() : mixed
Return values
mixed —setDescription()
public
setDescription( $description) : mixed
Parameters
Return values
mixed —setEnum()
public
setEnum( $enum) : mixed
Parameters
Return values
mixed —setItems()
public
setItems( $data) : mixed
Parameters
Return values
mixed —setName()
public
setName( $name) : mixed
Parameters
Return values
mixed —setPattern()
public
setPattern( $pattern) : mixed
Parameters
Return values
mixed —setType()
public
setType( $type) : mixed
Parameters
Return values
mixed —setValue()
public
setValue( $value) : mixed
Parameters
Return values
mixed —validate()
Validate the current value and ensure that it adheres to correct formatting, etc.
public
validate() : bool
Return values
bool —preparePattern()
Prepare the given pattern for Regex functions
protected
preparePattern( $pattern) : string
Parameters
Return values
string —stockProperty()
Stock a schema property only if set
protected
static stockProperty(array<string|int, mixed> $data, $property) : mixed