Class ContaoWidgetManager.

This class is responsible for creating widgets and processing data through them.

 Methods

Create a new instance.

__construct(\ContaoCommunityAlliance\DcGeneral\EnvironmentInterface $environment, \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface $model) 

Parameters

$environment

\ContaoCommunityAlliance\DcGeneral\EnvironmentInterface

The environment in use.

$model

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface

The model for which widgets shall be generated.

Decode a value from native data of the data provider to the widget via event.

decodeValue(string $property, mixed $value) : mixed

Parameters

$property

string

The property.

$value

mixed

The value of the property.

Returns

mixed

Encode a value from the widget to native data of the data provider via event.

encodeValue(string $property, mixed $value, \ContaoCommunityAlliance\DcGeneral\Data\PropertyValueBag $propertyValues) : mixed

Parameters

$property

string

The property.

$value

mixed

The value of the property.

$propertyValues

\ContaoCommunityAlliance\DcGeneral\Data\PropertyValueBag

The property value bag the property value originates from.

Returns

mixed

{@inheritdoc}

getEnvironment() 

Retrieve the instance of a widget for the given property.

getWidget(string $property, \ContaoCommunityAlliance\DcGeneral\Data\PropertyValueBag $inputValues) : \Widget
SuppressWarnings (PHPMD.Superglobals)
SuppressWarnings (PHPMD.CamelCaseVariableName)

Parameters

$property

string

Name of the property for which the widget shall be retrieved.

$inputValues

\ContaoCommunityAlliance\DcGeneral\Data\PropertyValueBag

The input values to use (optional).

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralInvalidArgumentException When an unknown property has been passed.
\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException When No widget could be build.
\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralInvalidArgumentException When property is not defined in the property definitions.

Returns

{@inheritDoc}

hasWidget($property) 

Parameters

$property

Function for pre-loading the tiny mce.

preLoadRichTextEditor() : void
SuppressWarnings (PHPMD.Superglobals)
SuppressWarnings (PHPMD.CamelCaseVariableName)

Exceptions

\Exception When the rich text editor config file can not be found.

{@inheritDoc}

processErrors(\ContaoCommunityAlliance\DcGeneral\Data\PropertyValueBag $propertyValues) 

Parameters

$propertyValues

{@inheritDoc}

processInput(\ContaoCommunityAlliance\DcGeneral\Data\PropertyValueBag $propertyValues) 
SuppressWarnings (PHPMD.Superglobals)
SuppressWarnings (PHPMD.CamelCaseVariableName)

Parameters

$propertyValues

Render the widget for the named property.

renderWidget(string $property, bool $ignoreErrors, \ContaoCommunityAlliance\DcGeneral\Data\PropertyValueBag $inputValues) : string

Parameters

$property

string

The name of the property for which the widget shall be rendered.

$ignoreErrors

bool

Flag if the error property of the widget shall get cleared prior rendering.

$inputValues

\ContaoCommunityAlliance\DcGeneral\Data\PropertyValueBag

The input values to use (optional).

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException For unknown properties.

Returns

string

Build the date picker string.

buildDatePicker(\Contao\Widget $objWidget) : string
SuppressWarnings (PHPMD.Superglobals)
SuppressWarnings (PHPMD.CamelCaseVariableName)

Parameters

$objWidget

\Contao\Widget

The widget instance to generate the date picker string for.

Returns

string

Generate the help msg for a property.

generateHelpText(string $property) : string
SuppressWarnings (PHPMD.Superglobals)
SuppressWarnings (PHPMD.CamelCaseVariableName)

Parameters

$property

string

The name of the property.

Returns

string

 Properties

 

The environment in use.

$environment : \ContaoCommunityAlliance\DcGeneral\EnvironmentInterface
 

The model for which widgets shall be generated.

$model : \ContaoCommunityAlliance\DcGeneral\Data\ModelInterface