ApiOpenStudio PHPDoc

ResourceValidator
in package

Class ResourceValidator

Validate a resource definition.

Table of Contents

$helper  : ProcessorHelper
Processor helper class.
$db  : ADODB_mysqli
DB connection class.
$logger  : MonologWrapper
Logging class.
__construct()  : mixed
Constructor. Store processor metadata and request data in object.
validate()  : void
Validate input data is well formed.
validateDetails()  : void
Validate the details of a security or process processor.
validateIdenticalIds()  : bool
Search for identical IDs.
validateTypeValue()  : bool
Compare an element type and possible literal value or type in the input resource with the definition in the Processor it refers to. If the element type is processor, recursively iterate through, using the calling function _validateProcessor().

Properties

Methods

__construct()

Constructor. Store processor metadata and request data in object.

public __construct(ADOConnection $db, MonologWrapper $logger) : mixed
Parameters
$db : ADOConnection

Database.

$logger : MonologWrapper

Logger.

Return values
mixed

validate()

Validate input data is well formed.

public validate(array<string|int, mixed> $data) : void
Parameters
$data : array<string|int, mixed>

Resource metadata array.

Tags
throws
ApiException|ReflectionException

Input data not well formed.

Return values
void

validateDetails()

Validate the details of a security or process processor.

private validateDetails(array<string|int, mixed> $meta) : void
Parameters
$meta : array<string|int, mixed>

Resource metadata array.

Tags
throws
ApiException|ReflectionException

Error found in validating the resource.

Return values
void

validateIdenticalIds()

Search for identical IDs.

private validateIdenticalIds(array<string|int, mixed> $meta) : bool
Parameters
$meta : array<string|int, mixed>

Resource metadata array.

Tags
throws
ApiException

Identical ID found.

Return values
bool

validateTypeValue()

Compare an element type and possible literal value or type in the input resource with the definition in the Processor it refers to. If the element type is processor, recursively iterate through, using the calling function _validateProcessor().

private validateTypeValue(mixed $element, array<string|int, mixed> $accepts, string|int $id) : bool
Parameters
$element : mixed

Literal value in a resource to validate against $accepts.

$accepts : array<string|int, mixed>

Array of types the processor can accept.

$id : string|int

Processor ID.

Tags
throws
ApiException

Invalid $element.

Return values
bool

Search results