Contains multiple palettes, organised by its name.

 Methods

Create a deep clone of the palette collection.

__clone() : void

Add a palette to this collection.

addPalette(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface $palette) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface

Add multiple palettes to this collection.

addPalettes(array|\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface[] $palettes) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface

Find the palette matching model and input parameters.

findPalette(\ContaoCommunityAlliance\DcGeneral\Data\ModelInterface|null $model, \ContaoCommunityAlliance\DcGeneral\Data\PropertyValueBag $input) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface

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 palette for the given name.

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

Parameters

$paletteName

string

The palette name.

Returns

Check if a palette exists in this collection.

hasPalette(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface $palette) : bool

Check if a palette for the given name exists in this collection.

hasPaletteByName(string $paletteName) : bool
deprecated Only for backwards compatibility, we will remove palette names in the future!

Parameters

$paletteName

string

The palette name.

Returns

bool

Remove a palette from this collection.

removePalette(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface $palette) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface

Set all palettes in this collection.

setPalettes(array|\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface[] $palettes) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteCollectionInterface