src/CoreBundle/EventListener/DcGeneral/Table/AbstractPaletteRestrictionListener.php
protected function getLegend($name, $palette, $prevLegend = null)
    {
        if (strpos($name, '+') === 0) {
            $name = substr($name, 1);
        }

        if (!$palette->hasLegend($name)) {
            $palette->addLegend(new Legend($name), $prevLegend);
        }

        return $palette->getLegend($name);
    }
protected function getLegend($name, $palette, $prevLegend = null)
    {
        if (strpos($name, '+') === 0) {
            $name = substr($name, 1);
        }

        if (!$palette->hasLegend($name)) {
            $palette->addLegend(new Legend($name), $prevLegend);
        }

        return $palette->getLegend($name);
    }
Retrieve the legend with the given name.

@param string           $name       Name of the legend.

@param PaletteInterface $palette    The palette.

@param LegendInterface  $prevLegend The previous legend.

@return LegendInterface