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

        if ($this->legend) {
            $this->finishLegend();
        }
        if ($this->condition) {
            $this->finishCondition();
        }

        $event = new FinishPaletteEvent($this->palette, $this);
        $this->dispatchEvent($event);
        $palette = $event->getPalette();

        if ($this->paletteCollection) {
            $this->paletteCollection->addPalette($palette);
        }

        $this->palette = null;

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

        if ($this->legend) {
            $this->finishLegend();
        }
        if ($this->condition) {
            $this->finishCondition();
        }

        $event = new FinishPaletteEvent($this->palette, $this);
        $this->dispatchEvent($event);
        $palette = $event->getPalette();

        if ($this->paletteCollection) {
            $this->paletteCollection->addPalette($palette);
        }

        $this->palette = null;

        return $this;
    }
public function finishPalette ( & $ palette = null ) { if ( ! $ this -> palette ) { throw new DcGeneralRuntimeException ( 'Palette is missing, please create a palette first' ) ; } if ( $ this -> legend ) { $ this -> finishLegend ( ) ; } if ( $ this -> condition ) { $ this -> finishCondition ( ) ; } $ event = new FinishPaletteEvent ( $ this -> palette , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ palette = $ event -> getPalette ( ) ; if ( $ this -> paletteCollection ) { $ this -> paletteCollection -> addPalette ( $ palette ) ; } $ this -> palette = null ; return $ this ; }
Finish the current palette.

@param PaletteInterface $palette Return the final palette.

@return PaletteBuilder

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