The palette builder is used to build palette collections, palettes, legends, properties and conditions.

SuppressWarnings (PHPMD.LongVariable)

 Methods

Create a new palette builder.

__construct(\ContaoCommunityAlliance\DcGeneral\DataDefinition\ContainerInterface $container) 

Parameters

$container

\ContaoCommunityAlliance\DcGeneral\DataDefinition\ContainerInterface

The container for which the palettes shall be built.

Add a custom condition to last created property or palette.

addCondition(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Condition\Palette\PaletteConditionInterface|\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Condition\Property\PropertyConditionInterface $condition, string $scope) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Start a new default-palette condition and chain with previous condition.

chainDefaultPaletteCondition() : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Start a new property-value condition and chain with previous condition.

chainPropertyValueCondition(string $propertyName, mixed $propertyValue, bool $strict, string $conjunction) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Parameters

$propertyName

string

The name of the property.

$propertyValue

mixed

The value of the property.

$strict

bool

Flag if the comparison shall be strict (type safe).

$conjunction

string

The conjunction.

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException If neither a palette nor a property is stored in the builder.

Returns

Factory method to create a new palette builder.

create(\ContaoCommunityAlliance\DcGeneral\DataDefinition\ContainerInterface $container) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
Static

Parameters

$container

\ContaoCommunityAlliance\DcGeneral\DataDefinition\ContainerInterface

The data definition container for which the palettes shall get built.

Returns

Start a new palette.

createPalette(string|null $name) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Parameters

$name

stringnull

Only for backwards compatibility, We will remove palette names in the future (deprecated).

Returns

Start a new single property or set of properties.

createProperty(string $propertyName, \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PropertyInterface $_) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
SuppressWarnings (PHPMD.UnusedFormalParameter)
SuppressWarnings (PHPMD.ShortVariable)
SuppressWarnings (PHPMD.CamelCaseParameterName)

Parameters

$propertyName

string

The name of the property.

$_

\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PropertyInterface

Any more subsequent property names to be used.

Returns

Start a new property-value condition.

createPropertyValueCondition(string $propertyName, mixed $propertyValue, bool $strict) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Parameters

$propertyName

string

The name of the property.

$propertyValue

mixed

The value of the property.

$strict

bool

Flag if the comparison shall be strict (type safe).

Exceptions

\ContaoCommunityAlliance\DcGeneral\Exception\DcGeneralRuntimeException If neither a palette nor a property is stored in the builder.

Returns

Finish the current condition.

finishCondition(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Condition\Property\PropertyConditionInterface|\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Condition\Palette\PaletteConditionInterface $condition) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Finish the current legend.

finishLegend(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface $legend) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Finish the current palette.

finishPalette(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface $palette) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Finish the current palette collection.

finishPaletteCollection(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteCollectionInterface $collection) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Finish the current property or set of properties.

finishProperty(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PropertyInterface|\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PropertyInterface[] $property) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Return the default palette condition class name.

getDefaultPaletteConditionClassName() : string

Returns

string

Return the legend class name.

getLegendClassName() : string

Returns

string

Return the palette class name.

getPaletteClassName() : string

Returns

string

Return the palette collection class name.

getPaletteCollectionClassName() : string

Returns

string

Return the palette condition chain class name.

getPaletteConditionChainClassName() : string

Returns

string

Return the palette property value condition class name.

getPalettePropertyValueConditionClassName() : string

Returns

string

Return the property class name.

getPropertyClassName() : string

Returns

string

Return the property condition chain class name.

getPropertyConditionChainClassName() : string

Returns

string

Return the property value condition class name.

getPropertyValueConditionClassName() : string

Returns

string

Set the default palette condition class name.

setDefaultPaletteConditionClassName(string $defaultPaletteConditionClassName) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Parameters

$defaultPaletteConditionClassName

string

The class name.

Returns

Set the legend class name.

setLegendClassName(string $legendClassName) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Parameters

$legendClassName

string

The class name.

Returns

Set the palette class name.

setPaletteClassName(string $paletteClassName) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Parameters

$paletteClassName

string

The class name.

Returns

Set the palette collection class name.

setPaletteCollectionClassName(string $paletteCollectionClassName) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Parameters

$paletteCollectionClassName

string

The class name.

Returns

Set the palette condition chain class name.

setPaletteConditionChainClassName(string $paletteConditionChainClassName) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Parameters

$paletteConditionChainClassName

string

The class name.

Returns

Set the palette property value condition class name.

setPalettePropertyValueConditionClassName(string $palettePropertyValueConditionClassName) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Parameters

$palettePropertyValueConditionClassName

string

The class name.

Returns

Set the property class name.

setPropertyClassName(string $propertyClassName) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Parameters

$propertyClassName

string

The class name.

Returns

Set the property condition chain class name.

setPropertyConditionChainClassName(string $propertyConditionChainClassName) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Parameters

$propertyConditionChainClassName

string

The class name.

Returns

Set the property value condition class name.

setPropertyValueConditionClassName(string $propertyValueConditionClassName) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Parameters

$propertyValueConditionClassName

string

The class name.

Returns

Reuse an existing legend.

useLegend(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface $legend) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Reuse an existing palette.

usePalette(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface $palette) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Reuse an existing palette collection.

usePaletteCollection(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteCollectionInterface $paletteCollection) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Reuse an existing property or set of properties.

useProperty(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PropertyInterface $property, \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PropertyInterface $_) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
SuppressWarnings (PHPMD.UnusedFormalParameter)
SuppressWarnings (PHPMD.ShortVariable)
SuppressWarnings (PHPMD.CamelCaseParameterName)

Parameters

Returns

Add a custom condition to last created palette.

addPaletteCondition(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Condition\Palette\PaletteConditionInterface $condition) : void

Add a custom condition to last created property.

addPropertyCondition(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Condition\Property\PropertyConditionInterface $condition, string $scope) : void

Create a palette condition chain.

createPropertyConditionChain(string $conjunction) : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Parameters

$conjunction

string

The conjunction to use (defaults to AND).

Returns

Dispatch an event over the global event dispatcher.

dispatchEvent(\ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\Builder\Event\BuilderEvent $event) : void
internal
SuppressWarnings (PHPMD.Superglobals)
SuppressWarnings (PHPMD.CamelCaseVariableName)

Parameters

 Properties

   

The data definition container.

$container : \ContaoCommunityAlliance\DcGeneral\DataDefinition\ContainerInterface
 

The the class to use for palette conditions.

$defaultPaletteConditionClass : \ReflectionClass
 

The class name of the class to use for palette conditions.

$defaultPaletteConditionClassName : string
 

The legend currently working on.

$legend : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface | null
 

The class to use for palette legends.

$legendClass : \ReflectionClass
 

The class name of the class to use for palette legends.

$legendClassName : string
 

The palette currently working on.

$palette : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface | null
 

The class to use for palettes.

$paletteClass : \ReflectionClass
 

The class name of the class to use for palettes.

$paletteClassName : string
 

The palette collection currently working on.

$paletteCollection : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteCollectionInterface | null
 

The class to use for palette collections.

$paletteCollectionClass : \ReflectionClass
 

The class name of the class to use for palette collections.

$paletteCollectionClassName : string
 

The the class to use for palette condition chains.

$paletteConditionChainClass : \ReflectionClass
 

The class name of the class to use for palette condition chains.

$paletteConditionChainClassName : string
 

The class to use for property value conditions.

$palettePropertyValueConditionClass : \ReflectionClass
 

The class name of the class to use for property value conditions.

$palettePropertyValueConditionClassName : string
 

The property currently working on.

$property : \ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PropertyInterface | null
 

The class to use for palette properties.

$propertyClass : \ReflectionClass
 

The class name of the class to use for palette properties.

$propertyClassName : string
 

The class to use for property condition chains.

$propertyConditionChainClass : \ReflectionClass
 

The class name of the class to use for property condition chains.

$propertyConditionChainClassName : string
 

The the class to use for property value conditions.

$propertyValueConditionClass : \ReflectionClass
 

The class name of the class to use for property value conditions.

$propertyValueConditionClassName : string

 Constants

 

The condition define if the property is editable.

EDITABLE 
 

The condition define if the property is viewable.

VISIBLE