\App\ApiModule\Version0\ModelsJsonSchemaValidator

API JSON schema validator

Summary

Methods
Properties
Constants
delete()
exists()
read()
write()
__construct()
getDirectory()
validate()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
fixPermissions()
$directory
$commandManager
N/A

Properties

$directory

$directory : string

Type

normal — Directory with files

$commandManager

$commandManager : \App\CoreModule\Models\CommandManager

Type

normal — Command manager

Methods

delete()

delete(string  $fileName) : void

Deletes the file

Parameters

string $fileName

File name

Throws

\Nette\IOException

exists()

exists(string  $fileName) : bool

Checks if the file exists

Parameters

string $fileName

File name

Returns

bool —

Is file exists?

read()

read(string  $fileName) : mixed

Reads the file

Parameters

string $fileName

File name

Throws

\Nette\IOException

Returns

mixed —

File content

write()

write(string  $fileName, mixed  $content) : void

Writes into the file

Parameters

string $fileName

File name

mixed $content

File content

Throws

\Nette\IOException

__construct()

__construct(\App\CoreModule\Models\CommandManager  $commandManager) : mixed

Constructor

Parameters

\App\CoreModule\Models\CommandManager $commandManager

Command manager

Returns

mixed

getDirectory()

getDirectory() : string

Returns the directory with files

Returns

string —

Directory with files

validate()

validate(string  $schema, \Apitte\Core\Http\ApiRequest  $request) : void

Validates JSON

Parameters

string $schema

JSON schema file name

\Apitte\Core\Http\ApiRequest $request

API request

Throws

\App\CoreModule\Exceptions\InvalidJsonException
\Nette\Utils\JsonException

fixPermissions()

fixPermissions(string  $fileName) : void

Fixes the permissions

Parameters

string $fileName

File name