A legend group a lot of properties.

 Methods

Create a deep clone of the legend.

__clone() : void

Add all properties to this legend.

addProperties(array|\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PropertyInterface[] $properties, \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PropertyInterface $before) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface

Add a property to this legend.

addProperty(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PropertyInterface $property, \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PropertyInterface $before) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface

Return the name of this legend (e.g. "title", not "title_legend").

getName() : string

Returns

string

Get all properties in this legend.

getProperties(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface|null $model, \ContaoCommunityAlliance\DcGeneral\Data\PropertyValueBag $input) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PropertyInterface[]

Parameters

$model

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterfacenull

If given, subpalettes will be evaluated depending on the model. If no model is given, all properties will be returned, including subpalette properties.

$input

\ContaoCommunityAlliance\DcGeneral\Data\PropertyValueBag

If given, subpalettes will be evaluated depending on the input data. If no model and no input data is given, all properties will be returned, including subpalette properties.

Returns

Get a property by name from this legend.

getProperty(string $propertyName) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PropertyInterface

Parameters

$propertyName

string

The property name.

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException If the this legend does not contain the property.

Returns

Determine if a property with the name exists in this legend.

hasProperty(string $propertyName) : bool

Parameters

$propertyName

string

The property name.

Returns

bool

Remove a property from this legend.

removeProperty(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PropertyInterface $property) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface

Set if this legend's initial state is visible (expanded).

setInitialVisibility(bool $value) : bool

Parameters

$value

bool

The visibility state.

Returns

bool

Set the name of this legend (e.g. "title", not "title_legend").

setName(string $name) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface

Return the palette this legend belongs to.

setPalette(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface|null $palette) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface

Set the properties of this legend.

setProperties(array|\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PropertyInterface[] $properties) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface