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

        if ($this->palette) {
            $this->finishPalette();
        }

        $event = new FinishPaletteCollectionEvent($this->paletteCollection, $this);
        $this->dispatchEvent($event);
        $collection = $event->getPaletteCollection();

        $this->paletteCollection = null;

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

        if ($this->palette) {
            $this->finishPalette();
        }

        $event = new FinishPaletteCollectionEvent($this->paletteCollection, $this);
        $this->dispatchEvent($event);
        $collection = $event->getPaletteCollection();

        $this->paletteCollection = null;

        return $this;
    }
public function finishPaletteCollection ( & $ collection = null ) { if ( ! $ this -> paletteCollection ) { throw new DcGeneralRuntimeException ( 'Palette collection is missing, please create a palette collection first' ) ; } if ( $ this -> palette ) { $ this -> finishPalette ( ) ; } $ event = new FinishPaletteCollectionEvent ( $ this -> paletteCollection , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ collection = $ event -> getPaletteCollection ( ) ; $ this -> paletteCollection = null ; return $ this ; }
Finish the current palette collection.

@param PaletteCollectionInterface $collection Return the final palette collection.

@return PaletteBuilder

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