public function onBlock(BlockEvent $event)
    {
        $identifier = $event->getSetting('id', null);

        if (null === $identifier) {
            return;
        }

        $block = new Block();
        $block->setId(uniqid());
        $block->setSettings($event->getSettings());
        $block->setType($this->blockService->getName());

        $event->addBlock($block);
    }
public function onBlock(BlockEvent $event)
    {
        $identifier = $event->getSetting('id', null);

        if (null === $identifier) {
            return;
        }

        $block = new Block();
        $block->setId(uniqid());
        $block->setSettings($event->getSettings());
        $block->setType($this->blockService->getName());

        $event->addBlock($block);
    }
public function onBlock ( BlockEvent $ event ) { $ identifier = $ event -> getSetting ( 'id' , null ) ; if ( null === $ identifier ) { return ; } $ block = new Block ( ) ; $ block -> setId ( uniqid ( ) ) ; $ block -> setSettings ( $ event -> getSettings ( ) ) ; $ block -> setType ( $ this -> blockService -> getName ( ) ) ; $ event -> addBlock ( $ block ) ; }
Add blocks services to event.

@param BlockEvent $event
Add blocks services to event .