Class LegacyPalettesParser.
This class parses the palettes from a legacy DCA into the palette collection
definitions being used in DcGeneral.
Methods summary
public
DcGeneral\DataDefinition\Palette\PaletteCollectionInterface
|
|
public
DcGeneral\DataDefinition\Palette\PaletteCollectionInterface
|
#
parsePalettes( array $palettes, array $subPaletteProperties = array(), array $selectorFieldNames = array(), DcGeneral\DataDefinition\Palette\PaletteCollectionInterface $collection = null )
Parse the given palettes.
Parse the given palettes.
Parameters
- $palettes
array(string => string) $palettes The array of palettes, e.g. <span
class="php-keyword1">array</span>(<span
class="php-quote">'default'</span> => <span
class="php-quote">'{title_legend},title'</span>) .
- $subPaletteProperties
array(string => string) $subPaletteProperties Mapped array from subpalette [optional].
- $selectorFieldNames
array $selectorFieldNames List of names of the properties to be used as selector
[optional].
- $collection
DcGeneral\DataDefinition\Palette\PaletteCollectionInterface
$collection The palette collection to populate [optional].
Returns
|
public
DcGeneral\DataDefinition\Palette\Palette
|
#
parsePalette( string $paletteSelector, string $fields, array $subPaletteProperties = array(), array $selectorFieldNames = array(), DcGeneral\DataDefinition\Palette\PaletteInterface $palette = null )
Parse a single palette.
Parameters
- $paletteSelector
string $paletteSelector The selector for the palette.
- $fields
string $fields The fields contained within the palette.
- $subPaletteProperties
array(string => PropertyInterface) $subPaletteProperties The sub palette properties
[optional].
- $selectorFieldNames
array(string) $selectorFieldNames The names of all properties being used as selectors
[optional].
- $palette
DcGeneral\DataDefinition\Palette\PaletteInterface
$palette The palette to be populated [optional].
Returns
|
public
DcGeneral\DataDefinition\Palette\Condition\Palette\PaletteConditionInterface
|
#
createPaletteCondition( string $paletteSelector, array $selectorFieldNames )
Parse the palette selector and create the corresponding condition.
Parse the palette selector and create the corresponding condition.
Parameters
- $paletteSelector
string $paletteSelector Create the condition for the selector.
- $selectorFieldNames
array $selectorFieldNames The property names to be used as selectors.
Returns
|
public
array(string
|
#
parseSubpalettes( array $subpalettes, array $selectorFieldNames = array() )
Parse the sub palettes and return the properties for each selector
property.
Parse the sub palettes and return the properties for each selector
property.
Parameters
- $subpalettes
array $subpalettes The sub palettes to parse.
- $selectorFieldNames
array $selectorFieldNames Names of the selector properties [optional].
Returns
array(string => PropertyInterface[])
|
public
DcGeneral\DataDefinition\Palette\PropertyInterface[]
|
#
parseSubpalette( string $subPaletteSelector, string $childFields, array $selectorFieldNames = array() )
Parse the list of sub palette fields into an array of properties.
Parse the list of sub palette fields into an array of properties.
Parameters
- $subPaletteSelector
string $subPaletteSelector The selector in use.
- $childFields
string $childFields List of the properties for the sub palette.
- $selectorFieldNames
array $selectorFieldNames List of the selector properties [optional].
Returns
|
public
string
|
#
createSubpaletteSelectorFieldName( string $subPaletteSelector, array $selectorFieldNames = array() )
Translate a sub palette selector into the real name of a property.
Translate a sub palette selector into the real name of a property.
This method supports the following cases for the sub palette selector:
Case 1: the sub palette selector contain a combination of "property name" +
'_' + value in which we require that the "property name" is contained within
$selectorFieldNames. In this cases a select/radio sub palette is in place.
Case 2: the sub palette selector is only a "property name", the value is then
implicated to be true. In this cases a checkbox sub palette is in place.
Parameters
- $subPaletteSelector
string $subPaletteSelector The selector being evaluated.
- $selectorFieldNames
array $selectorFieldNames The names of the properties to be used as selectors
[optional].
Returns
string
|
public
DcGeneral\DataDefinition\Palette\Condition\Property\PropertyTrueCondition |DcGeneral\DataDefinition\Palette\Condition\Property\PropertyValueCondition |null
|
#
createSubpaletteCondition( string $subPaletteSelector, array $selectorFieldNames = array() )
Parse the sub palette selector and create the corresponding condition.
Parse the sub palette selector and create the corresponding condition.
This method supports the following cases for the sub palette selector:
Case 1: the sub palette selector contain a combination of "property name" +
'_' + value in which we require that the "property name" is contained within
$selectorFieldNames. In this cases a select/radio sub palette is in place.
Case 2: the sub palette selector is only a "property name", the value is then
implicated to be true. In this cases a checkbox sub palette is in place.
Parameters
- $subPaletteSelector
string $subPaletteSelector The selector being evaluated.
- $selectorFieldNames
array $selectorFieldNames The names of the properties to be used as selectors
[optional].
Returns
|