Overview

Namespaces

  • DcGeneral
    • Clipboard
    • Contao
      • Callback
      • Compatibility
      • DataDefinition
        • Definition
      • Dca
        • Builder
          • Legacy
        • Definition
        • Palette
        • Populator
      • Event
      • View
        • Contao2BackendView
          • Event
    • Controller
    • Data
    • DataDefinition
      • Builder
      • Definition
        • Properties
        • View
          • Panel
      • ModelRelationship
      • Palette
        • Builder
          • Event
        • Condition
          • Palette
          • Property
    • EnvironmentPopulator
    • Event
    • Exception
    • Factory
      • Event
    • Panel
    • View
      • Event

Classes

  • PaletteBuilder
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo

Class PaletteBuilder

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

Namespace: DcGeneral\DataDefinition\Palette\Builder
Located at DataDefinition/Palette/Builder/PaletteBuilder.php
Methods summary
public static DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# create( DcGeneral\DataDefinition\ContainerInterface $container )

Factory method to create a new palette builder.

Factory method to create a new palette builder.

Parameters

$container
DcGeneral\DataDefinition\ContainerInterface
$container The data definition container for which the palettes shall get built.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
public
# __construct( DcGeneral\DataDefinition\ContainerInterface $container )

Create a new palette builder.

Create a new palette builder.

Parameters

$container
DcGeneral\DataDefinition\ContainerInterface
$container The container for which the palettes shall be built.
public DcGeneral\DataDefinition\ContainerInterface
# getContainer( )

Retrieve the container.

Retrieve the container.

Returns

DcGeneral\DataDefinition\ContainerInterface
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# setPaletteCollectionClassName( string $paletteCollectionClassName )

Set the palette collection class name.

Set the palette collection class name.

Parameters

$paletteCollectionClassName
string
$paletteCollectionClassName The class name.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
public string
# getPaletteCollectionClassName( )

Return the palette collection class name.

Return the palette collection class name.

Returns

string
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# setPaletteClassName( string $paletteClassName )

Set the palette class name.

Set the palette class name.

Parameters

$paletteClassName
string
$paletteClassName The class name.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
public string
# getPaletteClassName( )

Return the palette class name.

Return the palette class name.

Returns

string
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# setLegendClassName( string $legendClassName )

Set the legend class name.

Set the legend class name.

Parameters

$legendClassName
string
$legendClassName The class name.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
public string
# getLegendClassName( )

Return the legend class name.

Return the legend class name.

Returns

string
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# setPropertyClassName( string $propertyClassName )

Set the property class name.

Set the property class name.

Parameters

$propertyClassName
string
$propertyClassName The class name.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
public string
# getPropertyClassName( )

Return the property class name.

Return the property class name.

Returns

string
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# setPaletteConditionChainClassName( string $paletteConditionChainClassName )

Set the palette condition chain class name.

Set the palette condition chain class name.

Parameters

$paletteConditionChainClassName
string
$paletteConditionChainClassName The class name.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
public string
# getPaletteConditionChainClassName( )

Return the palette condition chain class name.

Return the palette condition chain class name.

Returns

string
public DcGeneral\DataDefinition\Palette\PaletteCollectionInterface|null
# getPaletteCollection( )

Return the current palette collection object.

Return the current palette collection object.

Returns

DcGeneral\DataDefinition\Palette\PaletteCollectionInterface|null
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# setDefaultPaletteConditionClassName( string $defaultPaletteConditionClassName )

Set the default palette condition class name.

Set the default palette condition class name.

Parameters

$defaultPaletteConditionClassName
string
$defaultPaletteConditionClassName The class name.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
public string
# getDefaultPaletteConditionClassName( )

Return the default palette condition class name.

Return the default palette condition class name.

Returns

string
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# setPalettePropertyValueConditionClassName( string $palettePropertyValueConditionClassName )

Set the palette property value condition class name.

Set the palette property value condition class name.

Parameters

$palettePropertyValueConditionClassName
string
$palettePropertyValueConditionClassName The class name.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
public string
# getPalettePropertyValueConditionClassName( )

Return the palette property value condition class name.

Return the palette property value condition class name.

Returns

string
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# setPropertyConditionChainClassName( string $propertyConditionChainClassName )

Set the property condition chain class name.

Set the property condition chain class name.

Parameters

$propertyConditionChainClassName
string
$propertyConditionChainClassName The class name.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
public string
# getPropertyConditionChainClassName( )

Return the property condition chain class name.

Return the property condition chain class name.

Returns

string
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# setPropertyValueConditionClassName( string $propertyValueConditionClassName )

Set the property value condition class name.

Set the property value condition class name.

Parameters

$propertyValueConditionClassName
string
$propertyValueConditionClassName The class name.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
public string
# getPropertyValueConditionClassName( )

Return the property value condition class name.

Return the property value condition class name.

Returns

string
public DcGeneral\DataDefinition\Palette\PaletteInterface|null
# getPalette( )

Return the current palette object.

Return the current palette object.

Returns

DcGeneral\DataDefinition\Palette\PaletteInterface|null
public DcGeneral\DataDefinition\Palette\LegendInterface|null
# getLegend( )

Return the current legend object.

Return the current legend object.

Returns

DcGeneral\DataDefinition\Palette\LegendInterface|null
public DcGeneral\DataDefinition\Palette\PropertyInterface|null
# getProperty( )

Return the current property object.

Return the current property object.

Returns

DcGeneral\DataDefinition\Palette\PropertyInterface|null
public DcGeneral\DataDefinition\Palette\Condition\Palette\PaletteConditionInterface|DcGeneral\DataDefinition\Palette\Condition\Property\PropertyConditionInterface|null
# getCondition( )

Return the current condition object.

Return the current condition object.

Returns

DcGeneral\DataDefinition\Palette\Condition\Palette\PaletteConditionInterface|DcGeneral\DataDefinition\Palette\Condition\Property\PropertyConditionInterface|null
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# usePaletteCollection( DcGeneral\DataDefinition\Palette\PaletteCollectionInterface $paletteCollection )

Reuse an existing palette collection.

Reuse an existing palette collection.

Parameters

$paletteCollection
DcGeneral\DataDefinition\Palette\PaletteCollectionInterface
$paletteCollection The palette collection to reuse.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# createPaletteCollection( )

Start a new palette collection.

Start a new palette collection.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# finishPaletteCollection( DcGeneral\DataDefinition\Palette\PaletteCollectionInterface & $collection = null )

Finish the current palette collection.

Finish the current palette collection.

Parameters

$collection
DcGeneral\DataDefinition\Palette\PaletteCollectionInterface
$collection Return the final palette collection.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Throws

DcGeneral\Exception\DcGeneralRuntimeException
When no collection is stored.
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# usePalette( DcGeneral\DataDefinition\Palette\PaletteInterface $palette )

Reuse an existing palette.

Reuse an existing palette.

Parameters

$palette
DcGeneral\DataDefinition\Palette\PaletteInterface
$palette The palette to reuse.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# createPalette( string|null $name = null )

Start a new palette.

Start a new palette.

Parameters

$name
string|null
$name Only for backwards compatibility, we will remove palette names in the future (deprecated).

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# finishPalette( DcGeneral\DataDefinition\Palette\PaletteInterface & $palette = null )

Finish the current palette.

Finish the current palette.

Parameters

$palette
DcGeneral\DataDefinition\Palette\PaletteInterface
$palette Return the final palette.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Throws

DcGeneral\Exception\DcGeneralRuntimeException
When no palette is stored in the builder.
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# useLegend( DcGeneral\DataDefinition\Palette\LegendInterface $legend )

Reuse an existing legend.

Reuse an existing legend.

Parameters

$legend
DcGeneral\DataDefinition\Palette\LegendInterface
$legend The legend.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# createLegend( string $name )

Start a new legend.

Start a new legend.

Parameters

$name
string
$name Name of the legend.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# finishLegend( DcGeneral\DataDefinition\Palette\LegendInterface & $legend = null )

Finish the current legend.

Finish the current legend.

Parameters

$legend
DcGeneral\DataDefinition\Palette\LegendInterface
$legend Return the final legend.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Throws

DcGeneral\Exception\DcGeneralRuntimeException
When no legend is stored in the builder.
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# useProperty( DcGeneral\DataDefinition\Palette\PropertyInterface $property, DcGeneral\DataDefinition\Palette\PropertyInterface $_ = null )

Reuse an existing property or set of properties.

Reuse an existing property or set of properties.

Parameters

$property
DcGeneral\DataDefinition\Palette\PropertyInterface
$property The first property.
$_
DcGeneral\DataDefinition\Palette\PropertyInterface
$_ Any more subsequent properties to be used.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# createProperty( string $propertyName, DcGeneral\DataDefinition\Palette\PropertyInterface $_ = null )

Start a new single property or set of properties.

Start a new single property or set of properties.

Parameters

$propertyName
string
$propertyName The name of the property.
$_
DcGeneral\DataDefinition\Palette\PropertyInterface
$_ Any more subsequent property names to be used.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# finishProperty( DcGeneral\DataDefinition\Palette\PropertyInterface|DcGeneral\DataDefinition\Palette\PropertyInterface[] & $property = null )

Finish the current property or set of properties.

Finish the current property or set of properties.

Parameters

$property
DcGeneral\DataDefinition\Palette\PropertyInterface|DcGeneral\DataDefinition\Palette\PropertyInterface[]
$property Return the final property or set of properties.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Throws

DcGeneral\Exception\DcGeneralRuntimeException
When no property is stored in the builder.
protected DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# createPaletteConditionChain( )

Create a palette condition chain.

Create a palette condition chain.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
protected DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# createPropertyConditionChain( string $conjunction = DcGeneral\DataDefinition\Palette\Builder\PropertyConditionChain::AND_CONJUNCTION )

Create a palette condition chain.

Create a palette condition chain.

Parameters

$conjunction
string
$conjunction The conjunction to use (defaults to AND).

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# createDefaultPaletteCondition( )

Start a new default-palette condition.

Start a new default-palette condition.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Throws

DcGeneral\Exception\DcGeneralRuntimeException
When no palette or property has been stored.
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# chainDefaultPaletteCondition( )

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

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

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Throws

DcGeneral\Exception\DcGeneralRuntimeException
When no palette or property has been stored.
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# createPropertyValueCondition( string $propertyName, mixed $propertyValue, boolean $strict = false )

Start a new property-value condition.

Start a new property-value condition.

Parameters

$propertyName
string
$propertyName The name of the property.
$propertyValue
mixed
$propertyValue The value of the property.
$strict
boolean
$strict Flag if the comparison shall be strict (type safe).

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Throws

DcGeneral\Exception\DcGeneralRuntimeException
If neither a palette nor a property is stored in the builder.
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# chainPropertyValueCondition( string $propertyName, mixed $propertyValue, boolean $strict = false, string $conjunction = DcGeneral\DataDefinition\Palette\Builder\PropertyConditionChain::AND_CONJUNCTION )

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

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

Parameters

$propertyName
string
$propertyName The name of the property.
$propertyValue
mixed
$propertyValue The value of the property.
$strict
boolean
$strict Flag if the comparison shall be strict (type safe).
$conjunction
string
$conjunction The conjunction.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Throws

DcGeneral\Exception\DcGeneralRuntimeException
If neither a palette nor a property is stored in the builder.
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# finishCondition( DcGeneral\DataDefinition\Palette\Condition\Property\PropertyConditionInterface|DcGeneral\DataDefinition\Palette\Condition\Palette\PaletteConditionInterface & $condition = null )

Finish the current condition.

Finish the current condition.

Parameters

$condition
DcGeneral\DataDefinition\Palette\Condition\Property\PropertyConditionInterface|DcGeneral\DataDefinition\Palette\Condition\Palette\PaletteConditionInterface
$condition Return the final condition.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Throws

DcGeneral\Exception\DcGeneralRuntimeException
If no condition is stored in the builder.
protected
# addPaletteCondition( DcGeneral\DataDefinition\Palette\Condition\Palette\PaletteConditionInterface $condition )

Add a custom condition to last created palette.

Add a custom condition to last created palette.

Parameters

$condition
DcGeneral\DataDefinition\Palette\Condition\Palette\PaletteConditionInterface
$condition The condition to add.

Throws

DcGeneral\Exception\DcGeneralRuntimeException
If the palette is missing.
protected
# addPropertyCondition( DcGeneral\DataDefinition\Palette\Condition\Property\PropertyConditionInterface $condition, string $scope = DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder::VISIBLE )

Add a custom condition to last created property.

Add a custom condition to last created property.

Parameters

$condition
DcGeneral\DataDefinition\Palette\Condition\Property\PropertyConditionInterface
$condition The condition to add.
$scope
string
$scope The scope.

Throws

DcGeneral\Exception\DcGeneralRuntimeException
If the the property is missing.
public DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder
# addCondition( DcGeneral\DataDefinition\Palette\Condition\Palette\PaletteConditionInterface|DcGeneral\DataDefinition\Palette\Condition\Property\PropertyConditionInterface $condition, string $scope = DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder::VISIBLE )

Add a custom condition to last created property or palette.

Add a custom condition to last created property or palette.

Parameters

$condition
DcGeneral\DataDefinition\Palette\Condition\Palette\PaletteConditionInterface|DcGeneral\DataDefinition\Palette\Condition\Property\PropertyConditionInterface
$condition The condition to add.
$scope
string
$scope The scope.

Returns

DcGeneral\DataDefinition\Palette\Builder\PaletteBuilder

Throws

DcGeneral\Exception\DcGeneralInvalidArgumentException
When an unknown condition type is passed.
protected
# dispatchEvent( DcGeneral\DataDefinition\Palette\Builder\Event\BuilderEvent $event )

Dispatch an event over the global event dispatcher.

Dispatch an event over the global event dispatcher.

Parameters

$event
DcGeneral\DataDefinition\Palette\Builder\Event\BuilderEvent
$event The event to dispatch.

Internal

Constants summary
string VISIBLE 'view'
#

The condition define if the property is viewable.

The condition define if the property is viewable.

string EDITABLE 'edit'
#

The condition define if the property is editable.

The condition define if the property is editable.

Properties summary
protected DcGeneral\DataDefinition\ContainerInterface $container
#

The data definition container.

The data definition container.

protected string $paletteCollectionClassName 'DcGeneral\DataDefinition\Palette\PaletteCollection'
#

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

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

protected ReflectionClass $paletteCollectionClass
#

The class to use for palette collections.

The class to use for palette collections.

protected string $paletteClassName 'DcGeneral\DataDefinition\Palette\Palette'
#

The class name of the class to use for palettes.

The class name of the class to use for palettes.

protected ReflectionClass $paletteClass
#

The class to use for palettes.

The class to use for palettes.

protected string $legendClassName 'DcGeneral\DataDefinition\Palette\Legend'
#

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

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

protected ReflectionClass $legendClass
#

The class to use for palette legends.

The class to use for palette legends.

protected string $propertyClassName 'DcGeneral\DataDefinition\Palette\Property'
#

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

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

protected ReflectionClass $propertyClass
#

The class to use for palette properties.

The class to use for palette properties.

protected string $paletteConditionChainClassName 'DcGeneral\DataDefinition\Palette\Condition\Palette\PaletteConditionChain'
#

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

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

protected ReflectionClass $paletteConditionChainClass
#

The the class to use for palette condition chains.

The the class to use for palette condition chains.

protected string $defaultPaletteConditionClassName 'DcGeneral\DataDefinition\Palette\Condition\Palette\DefaultPaletteCondition'
#

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

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

protected ReflectionClass $defaultPaletteConditionClass
#

The the class to use for palette conditions.

The the class to use for palette conditions.

protected string $palettePropertyValueConditionClassName 'DcGeneral\DataDefinition\Palette\Condition\Palette\PropertyValueCondition'
#

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

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

protected ReflectionClass $palettePropertyValueConditionClass
#

The class to use for property value conditions.

The class to use for property value conditions.

protected string $propertyConditionChainClassName 'DcGeneral\DataDefinition\Palette\Condition\Property\PropertyConditionChain'
#

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

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

protected ReflectionClass $propertyConditionChainClass
#

The class to use for property condition chains.

The class to use for property condition chains.

protected string $propertyValueConditionClassName 'DcGeneral\DataDefinition\Palette\Condition\Property\PropertyValueCondition'
#

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

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

protected ReflectionClass $propertyValueConditionClass
#

The the class to use for property value conditions.

The the class to use for property value conditions.

protected DcGeneral\DataDefinition\Palette\PaletteCollectionInterface|null $paletteCollection null
#

The palette collection currently working on.

The palette collection currently working on.

protected DcGeneral\DataDefinition\Palette\PaletteInterface|null $palette null
#

The palette currently working on.

The palette currently working on.

protected DcGeneral\DataDefinition\Palette\LegendInterface|null $legend null
#

The legend currently working on.

The legend currently working on.

protected DcGeneral\DataDefinition\Palette\PropertyInterface|null $property null
#

The property currently working on.

The property currently working on.

protected DcGeneral\DataDefinition\Palette\Condition\Property\PropertyConditionInterface|DcGeneral\DataDefinition\Palette\Condition\Palette\PaletteConditionInterface|DcGeneral\DataDefinition\ConditionChainInterface|null $condition null
#

The condition currently working on.

The condition currently working on.

contao-community-alliance/dc-general API documentation generated by ApiGen 2.8.0