src/DataDefinition/Palette/Builder/PaletteBuilder.php
public function finishLegend(&$legend = null)
    {
        if (!$this->legend) {
            throw new DcGeneralRuntimeException('Legend is missing, please create a legend first');
        }

        if ($this->property) {
            $this->finishProperty();
        }

        $event = new FinishLegendEvent($this->legend, $this);
        $this->dispatchEvent($event);
        $legend = $event->getLegend();

        if ($this->palette) {
            $this->palette->addLegend($legend);
        }

        $this->legend = null;

        return $this;
    }
public function finishLegend(&$legend = null)
    {
        if (!$this->legend) {
            throw new DcGeneralRuntimeException('Legend is missing, please create a legend first');
        }

        if ($this->property) {
            $this->finishProperty();
        }

        $event = new FinishLegendEvent($this->legend, $this);
        $this->dispatchEvent($event);
        $legend = $event->getLegend();

        if ($this->palette) {
            $this->palette->addLegend($legend);
        }

        $this->legend = null;

        return $this;
    }
public function finishLegend ( & $ legend = null ) { if ( ! $ this -> legend ) { throw new DcGeneralRuntimeException ( 'Legend is missing, please create a legend first' ) ; } if ( $ this -> property ) { $ this -> finishProperty ( ) ; } $ event = new FinishLegendEvent ( $ this -> legend , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ legend = $ event -> getLegend ( ) ; if ( $ this -> palette ) { $ this -> palette -> addLegend ( $ legend ) ; } $ this -> legend = null ; return $ this ; }
Finish the current legend.

@param LegendInterface $legend Return the final legend.

@return PaletteBuilder

@throws DcGeneralRuntimeException When no legend is stored in the builder.
Finish the current legend .