\App\ConfigModule\ModelsSchedulerSchemaManager

Scheduler schema manager

Summary

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

Properties

$schema

$schema : string

Type

normal — JSON schema file name

$directory

$directory : string

Type

normal — Directory with files

$commandManager

$commandManager : \App\CoreModule\Models\CommandManager

Type

normal — Command manager

$apiSchemaManager

$apiSchemaManager : \App\IqrfNetModule\Models\ApiSchemaManager

Type

normal — JSON API JSON schema manager

Methods

__construct()

__construct(\App\ConfigModule\Models\MainManager  $mainManager, \App\CoreModule\Models\CommandManager  $commandManager, \App\IqrfNetModule\Models\ApiSchemaManager  $apiSchemaManager) : mixed

Constructor

Parameters

\App\ConfigModule\Models\MainManager $mainManager

Main configuration manager

\App\CoreModule\Models\CommandManager $commandManager

Command manager

\App\IqrfNetModule\Models\ApiSchemaManager $apiSchemaManager

JSON API JSON schema manager

Returns

mixed

setSchema()

setSchema(string  $fileName) : void

Sets the JSON schema file name

Parameters

string $fileName

JSON schema file name

Throws

\App\CoreModule\Exceptions\NonexistentJsonSchemaException

validate()

validate(mixed  $json, bool  $tryFix = false) : bool

Validates JSON

Parameters

mixed $json

JSON to validate

bool $tryFix

Try fix JSON?

Throws

\App\CoreModule\Exceptions\InvalidJsonException
\App\ConfigModule\Exceptions\InvalidTaskMessageException
\Nette\Utils\JsonException
\App\CoreModule\Exceptions\NonexistentJsonSchemaException

Returns

bool —

Is the JSON valid?

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

getDirectory()

getDirectory() : string

Returns the directory with files

Returns

string —

Directory with files

fixPermissions()

fixPermissions(string  $fileName) : void

Fixes the permissions

Parameters

string $fileName

File name