MetaModels\DcGeneral\Events\Table\InputScreens\Subscriber::getLegend PHP Метод

getLegend() защищенный Метод

Retrieve the legend with the given name.
protected getLegend ( string $name, ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface $palette, ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface $prevLegend = null ) : ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface
$name string Name of the legend.
$palette ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface The palette.
$prevLegend ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface The previous legend.
Результат ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\LegendInterface
    protected function getLegend($name, $palette, $prevLegend = null)
    {
        if (!$palette->hasLegend($name)) {
            $palette->addLegend(new Legend($name), $prevLegend);
        }
        return $palette->getLegend($name);
    }