Contao\CoreBundle\DataContainer\PaletteManipulator::applyFieldToLegend PHP Method

applyFieldToLegend() private method

Adds fields to a legend.
private applyFieldToLegend ( array &$config, array $action, boolean $skipLegends = false )
$config array
$action array
$skipLegends boolean
    private function applyFieldToLegend(array &$config, array $action, $skipLegends = false)
    {
        // If $skipLegends is true, we usually only have one legend without name, so we simply append to that
        if ($skipLegends) {
            if (self::POSITION_PREPEND === $action['position']) {
                reset($config);
            } else {
                end($config);
            }
            $action['parents'] = [key($config)];
        }
        if ($this->canApplyToParent($config, $action, 'parents', 'position')) {
            return;
        }
        $this->applyFallback($config, $action, $skipLegends);
    }