class ConfigService implements ConfigServiceInterface

ConfigService class

Constants

CONFIG_FILE_PHP

Used for configBundles.php

CONFIG_FILE_YAML

Used for config_bundles.yaml

Properties

private ConfigFormFactoryInterface $configFormFactory Stores ConfigFormFactoryInterface
private ContainerInterface $container Stores ContainerInterface
private ServiceToolsInterface $serviceTools Stores ServiceToolsInterface

Methods

__construct(ContainerInterface $container, ConfigFormFactoryInterface $configFormFactory, ServiceToolsInterface $serviceTools)

No description

array
convertToArray(Config $config)

Converts Config to array

Form
createForm(string $bundle)

Call ConfigFormFactory to create config form

getBundleConfig(string $bundle)

Returns the configuration settings defined in the bundle.yaml

getBundles()

Gets all the bundles that have a bundle.yaml file

getConfig(string $bundle)

Returns config data for specified bundle

Config|null
getDefinedConfig(string $root)

Returns the values defined for the configuration of the bundle

array|null
getGlobalConfig()

Returns the global bundles definitions values

string
getCacheFolder()

Returns the cache folder

string
getConfigFolder()

Returns the config folder

mixed
getContainerParameter(string $parameter)

Returns the value of container's parameter

mixed
getParameter(string $parameter, string $bundle = null)

Returns the value of parameter

array
getParametersCacheFile(string $root, string $bundle = null)

Returns the array of bundles parameters from cache file

bool
hasParameter(string $parameter)

Checks if parameter is set

setConfig($data)

Writes config data for specified bundle to yaml file

writeYamlFile(array $globalConfig)

Writes config_bundles.yaml

writePhpFile(array $globalConfig)

Writes configBundles.php

Details

at line 60
__construct(ContainerInterface $container, ConfigFormFactoryInterface $configFormFactory, ServiceToolsInterface $serviceTools)

Parameters

ContainerInterface $container
ConfigFormFactoryInterface $configFormFactory
ServiceToolsInterface $serviceTools

at line 74
array convertToArray(Config $config)

Converts Config to array

Parameters

Config $config

Return Value

array

at line 92
Form createForm(string $bundle)

Call ConfigFormFactory to create config form

Parameters

string $bundle

Return Value

Form

at line 102
Config getBundleConfig(string $bundle)

Returns the configuration settings defined in the bundle.yaml

Parameters

string $bundle

Return Value

Config

Exceptions

LogicException

at line 141
getBundles()

Gets all the bundles that have a bundle.yaml file

at line 169
getConfig(string $bundle)

Returns config data for specified bundle

Parameters

string $bundle

at line 193
Config|null getDefinedConfig(string $root)

Returns the values defined for the configuration of the bundle

Parameters

string $root

Return Value

Config|null

at line 209
array|null getGlobalConfig()

Returns the global bundles definitions values

Return Value

array|null

at line 224
string getCacheFolder()

Returns the cache folder

Return Value

string

at line 232
string getConfigFolder()

Returns the config folder

Return Value

string

at line 242
mixed getContainerParameter(string $parameter)

Returns the value of container's parameter

Parameters

string $parameter

Return Value

mixed

at line 250
mixed getParameter(string $parameter, string $bundle = null)

Returns the value of parameter

Parameters

string $parameter
string $bundle

Return Value

mixed

Exceptions

LogicException

at line 269
array getParametersCacheFile(string $root, string $bundle = null)

Returns the array of bundles parameters from cache file

Parameters

string $root
string $bundle

Return Value

array

Exceptions

LogicException

at line 317
bool hasParameter(string $parameter)

Checks if parameter is set

Parameters

string $parameter

Return Value

bool

at line 336
setConfig($data)

Writes config data for specified bundle to yaml file

Parameters

$data

at line 367
writeYamlFile(array $globalConfig)

Writes config_bundles.yaml

Parameters

array $globalConfig

at line 388
writePhpFile(array $globalConfig)

Writes configBundles.php

Parameters

array $globalConfig