\App\ConfigModule\ModelsComponentManager

Component configuration manager

Summary

Methods
Properties
Constants
__construct()
add()
delete()
getId()
load()
list()
listDisabled()
save()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$fileManager
$fileName
N/A

Properties

$fileManager

$fileManager : \App\CoreModule\Models\JsonFileManager

Type

normal — JSON file manager

$fileName

$fileName : string

Type

normal — File name (without .json)

Methods

__construct()

__construct(\App\CoreModule\Models\JsonFileManager  $fileManager) : mixed

Constructor

Parameters

\App\CoreModule\Models\JsonFileManager $fileManager

JSON file manager

Returns

mixed

add()

add(array  $array) : void

Adds a new component

Parameters

array $array

Component's settings

Throws

\Nette\Utils\JsonException

delete()

delete(int  $id) : void

Deletes the component

Parameters

int $id

Component ID

Throws

\Nette\Utils\JsonException

getId()

getId(string  $name) : int|null

Returns component ID

Parameters

string $name

Components name

Returns

int|null —

Component ID

load()

load(int  $id) : array

Loads the component from main configuration JSON

Parameters

int $id

Component ID

Throws

\Nette\Utils\JsonException

Returns

array —

Array for form

list()

list() : array<string,bool|int|string>[]

Loads components from main configuration JSON

Throws

\Nette\Utils\JsonException

Returns

array[] —

Array for form

listDisabled()

listDisabled() : array<string,bool>|null

Returns disabled components

Returns

array|null —

Disabled components

save()

save(array  $components, int  $id) : void

Saves the component's configuration

Parameters

array $components

Component's configuration

int $id

Component ID

Throws

\Nette\Utils\JsonException