Interface EnvironmentInterface.

This interface describes the environment of a DcGeneral instance. It holds reference to the data providers, the view, the data definition etc. One could say the Environment is the glue of DcGeneral, holding everything together.

 Methods

Register a data provider to the environment.

addDataProvider(string $strSource, \ContaoCommunityAlliance\DcGeneral\Data\DataProviderInterface $dataProvider) : \ContaoCommunityAlliance\DcGeneral\EnvironmentInterface

Parameters

$strSource

string

The name of the source.

$dataProvider

\ContaoCommunityAlliance\DcGeneral\Data\DataProviderInterface

The data provider instance to register under the given name.

Returns

Retrieve the data provider for the named source.

getDataProvider(string|null $strSource) : \ContaoCommunityAlliance\DcGeneral\Data\DataProviderInterface
If a source name is given, the named data provider will get returned, if not given, the default data provider will get returned, the default is to be determined via: getEnvironment()->getDataDefinition()->getDataProvider()

Parameters

$strSource

stringnull

The name of the source.

Returns

Retrieve the data definition for the parent container. This applies only when in parented mode.

getParentDataDefinition() : \ContaoCommunityAlliance\DcGeneral\DataDefinition\ContainerInterface

Retrieve the data definition for the root container. This applies only when in hierarchical mode.

getRootDataDefinition() : \ContaoCommunityAlliance\DcGeneral\DataDefinition\ContainerInterface

Determine if the data provider with the given name exists.

hasDataProvider(string|null $strSource) : mixed

Parameters

$strSource

stringnull

The source name to check the providers for.

Returns

mixed

Remove a data provider from the environment.

removeDataProvider(string $strSource) : \ContaoCommunityAlliance\DcGeneral\EnvironmentInterface

Parameters

$strSource

string

The name of the source.

Returns

Set the base config registry to use.

setBaseConfigRegistry(\ContaoCommunityAlliance\DcGeneral\BaseConfigRegistryInterface $baseConfigRegistry) : \ContaoCommunityAlliance\DcGeneral\EnvironmentInterface

Set the the clipboard.

setClipboard(\ContaoCommunityAlliance\DcGeneral\Clipboard\ClipboardInterface $objClipboard) : \ContaoCommunityAlliance\DcGeneral\EnvironmentInterface

Set the Controller for the current setup.

setController(\ContaoCommunityAlliance\DcGeneral\Controller\ControllerInterface $objController) : \ContaoCommunityAlliance\DcGeneral\EnvironmentInterface

Set the data definition for this instance.

setDataDefinition(\ContaoCommunityAlliance\DcGeneral\DataDefinition\ContainerInterface $objContainer) : \ContaoCommunityAlliance\DcGeneral\EnvironmentInterface

Set the event dispatcher to use.

setEventDispatcher(\Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher) : \ContaoCommunityAlliance\DcGeneral\EnvironmentInterface

Set the input provider to use.

setInputProvider(\ContaoCommunityAlliance\DcGeneral\InputProviderInterface $objInputProvider) : \ContaoCommunityAlliance\DcGeneral\EnvironmentInterface

Set the data definition of the parent container.

setParentDataDefinition(\ContaoCommunityAlliance\DcGeneral\DataDefinition\ContainerInterface $objContainer) : \ContaoCommunityAlliance\DcGeneral\EnvironmentInterface

Set the data definition of the root container.

setRootDataDefinition(\ContaoCommunityAlliance\DcGeneral\DataDefinition\ContainerInterface $objContainer) : \ContaoCommunityAlliance\DcGeneral\EnvironmentInterface

Set the session storage to use.

setSessionStorage(\ContaoCommunityAlliance\DcGeneral\SessionStorageInterface $sessionStorage) : \ContaoCommunityAlliance\DcGeneral\EnvironmentInterface

Set the translation manager to use.

setTranslator(\ContaoCommunityAlliance\Translator\TranslatorInterface $manager) : \ContaoCommunityAlliance\DcGeneral\EnvironmentInterface

Set the View for the current setup.

setView(\ContaoCommunityAlliance\DcGeneral\View\ViewInterface $objView) : \ContaoCommunityAlliance\DcGeneral\EnvironmentInterface