\App\ConfigModule\ModelsGenericManager

Generic configuration form factory

Summary

Methods
Properties
Constants
__construct()
deleteFile()
getInstanceFileName()
getInstanceFiles()
list()
load()
loadInstance()
fixRequiredInterfaces()
getInstanceByProperty()
read()
save()
generateFileName()
getFileName()
getFileNameById()
getMessagings()
getComponentInstances()
setComponent()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$component
$fileManager
$fileName
$schemaManager
N/A

Properties

$component

$component : string

Type

normal — Component type

$fileManager

$fileManager : \App\CoreModule\Models\JsonFileManager

Type

normal — JSON file manager

$fileName

$fileName : string|null

Type

normal — File name (without .json)

$schemaManager

$schemaManager : \App\ConfigModule\Models\ComponentSchemaManager

Type

normal — JSON schema manager

Methods

__construct()

__construct(\App\CoreModule\Models\JsonFileManager  $fileManager, \App\ConfigModule\Models\ComponentSchemaManager  $schemaManager) : mixed

Constructor

Parameters

\App\CoreModule\Models\JsonFileManager $fileManager

JSON file manager

\App\ConfigModule\Models\ComponentSchemaManager $schemaManager

JSON schema manager

Returns

mixed

deleteFile()

deleteFile(string|null  $fileName = null) : void

Deletes a configuration

Parameters

string|null $fileName

File name

Throws

\Nette\IOException

getInstanceFileName()

getInstanceFileName(string  $instance) : string|null

Returns instance configuration file name

Parameters

string $instance

Instance name

Returns

string|null —

Instance file name

getInstanceFiles()

getInstanceFiles() : string[]

Gets component's instance files

Returns

string[] —

Files with component's instances

list()

list(bool  $withId = true) : array

Get a list of configurations

Parameters

bool $withId

Add instance ID

Returns

array —

Configurations

load()

load(int  $id) : array

Loads the configuration

Parameters

int $id

Configuration ID

Throws

\Nette\IOException
\Nette\Utils\JsonException

Returns

array —

Configuration in an array

loadInstance()

loadInstance(string  $instance) : array

Loads the configuration

Parameters

string $instance

Instance name

Throws

\Nette\Utils\JsonException

Returns

array —

Configuration in an array

fixRequiredInterfaces()

fixRequiredInterfaces(array  $configuration) : void

Fixes the required interfaces in the configuration

Parameters

array $configuration

Configuration to fix

Throws

\Nette\IOException
\Nette\Utils\JsonException

getInstanceByProperty()

getInstanceByProperty(string  $type, mixed  $value) : string|null

Gets an instance file name with the property

Parameters

string $type

Property type

mixed $value

Property value

Returns

string|null —

Instance file name

read()

read(string|null  $fileName = null) : array

Reads the configuration

Parameters

string|null $fileName

File name

Throws

\Nette\IOException
\Nette\Utils\JsonException

Returns

array —

Configuration in an array

save()

save(array  $array, string|null  $fileName = null) : void

Saves the configuration

Parameters

array $array

Configuration in an array

string|null $fileName

File name

Throws

\Nette\IOException
\Nette\Utils\JsonException

generateFileName()

generateFileName(array  $array) : string

Generates a configuration file name

Parameters

array $array

Configuration from form

Returns

string —

Generated file name

getFileName()

getFileName() : string|null

Gets the file name

Returns

string|null —

File name (without .json)

getFileNameById()

getFileNameById(int  $id) : string|null

Returns instance file name from instance ID

Parameters

int $id

Instance ID

Returns

string|null —

File name

getMessagings()

getMessagings() : array<string,string[]>

Gets available messagings

Returns

array

Available messagings

getComponentInstances()

getComponentInstances(string  $component) : string[]

Gets available instances of component

Parameters

string $component

Component

Returns

string[] —

Available instances of component

setComponent()

setComponent(string  $component) : void

Sets the component type

Parameters

string $component

Component name