\App\CoreModule\ModelsJsonSchemaManager

Tool for reading and validating JSON schemas

Summary

Methods
Properties
Constants
__construct()
delete()
exists()
read()
write()
getDirectory()
setSchemaFromComponent()
validate()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct(  configDir) : 

Constructor

Parameters

configDir

Directory with JSON schemas

Returns

delete()

delete(  fileName) : 

Delete the file

Parameters

fileName

File name

Returns

exists()

exists(  fileName) : 

Check if the file exists

Parameters

fileName

File name

Returns

Is file exists?

read()

read(  fileName) : 

Read the file

Parameters

fileName

File name

Returns

File content

write()

write(  fileName,   content) : 

Write to the file

Parameters

fileName

File name

content

File content

Returns

getDirectory()

getDirectory() : 

Return the directory with files

Returns

Directory with files

setSchemaFromComponent()

setSchemaFromComponent(  component) : 

Set file name of JSON schema from the component name

Parameters

component

Component name

Throws

\App\CoreModule\Models\NonExistingJsonSchemaException

Returns

validate()

validate(\stdClass  json) : 

Validate JSON

Parameters

\stdClass json

JSON to validate

Throws

\App\CoreModule\Models\InvalidJsonException
\App\CoreModule\Models\JsonException

Returns

Is the JSON valid?