A palette contains a set of properties, grouped by legends.

 Methods

Create a deep clone of the palette.

__clone() : void

Add a legend to this palette.

addLegend(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface $legend, \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface $before) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface

Add all legends to this palette.

addLegends(array|\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface[] $legends, \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface $before) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface

Determine if a legend exists in this palette.

containsLegend(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface $legend) : bool

Parameters

Returns

bool

Get all properties from all legends in this palette that are editable.

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

Parameters

$model

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterfacenull

If given, selectors will be evaluated depending on the model.

$input

\ContaoCommunityAlliance\DcGeneral\Data\PropertyValueBag

If given, selectors will be evaluated depending on the input data.

Returns

Return the legend with the given name.

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

Parameters

$name

string

The name of the legend to search for.

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException Is thrown if there is no legend found.

Returns

Return the name of this palette.

getName() : string
deprecated Only for backwards compatibility, we will remove palette names in the future!

Returns

string

Get all properties from all legends in this palette.

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, selectors will be evaluated depending on the model.

$input

\ContaoCommunityAlliance\DcGeneral\Data\PropertyValueBag

If given, selectors will be evaluated depending on the input data.

Returns

Get a property by name from this palette.

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

Parameters

$propertyName

string

The property name.

Exceptions

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

Returns

Get all properties from all legends in this palette that are visible.

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

Parameters

$model

\ContaoCommunityAlliance\DcGeneral\Data\ModelInterfacenull

If given, selectors will be evaluated depending on the model.

$input

\ContaoCommunityAlliance\DcGeneral\Data\PropertyValueBag

If given, selectors will be evaluated depending on the input data.

Returns

Determine if a legend with the given name exists in this palette.

hasLegend(string $name) : bool

Parameters

$name

string

The name of the legend to search for.

Returns

bool

Remove a legend from this palette.

removeLegend(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface $legend) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface

Set the condition bound to this palette.

setCondition(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Condition\Palette\PaletteConditionInterface|null $condition) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface

Set all legends to this palette.

setLegends(array|\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface[] $legends) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface

Set the name of this palette.

setName(string $name) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface
deprecated Only for backwards compatibility, we will remove palette names in the future!

Parameters

$name

string

The name.

Returns