public function removeAction(Request $request)
    {
        $block = $this->findBlockByRequest($request);
        $row = $block->getRow();

        try {
            $this->getEditor()->getBlockManager()->delete($block);
        } catch (EditorExceptionInterface $e) {
            return $this->handleException($e);
        }

        // Stores id for front removal
        $removedId = $this->getViewBuilder()->buildBlock($block)->getAttributes()->getId();

        $this->validate($row);
        $this->persist($row);

        $data = [
            'removed' => [$removedId],
            //'rows'    => [$this->getViewBuilder()->buildRow($row)],
        ];

        return $this->buildResponse($data, self::SERIALIZE_LAYOUT);
    }
public function removeAction(Request $request)
    {
        $block = $this->findBlockByRequest($request);
        $row = $block->getRow();

        try {
            $this->getEditor()->getBlockManager()->delete($block);
        } catch (EditorExceptionInterface $e) {
            return $this->handleException($e);
        }

        // Stores id for front removal
        $removedId = $this->getViewBuilder()->buildBlock($block)->getAttributes()->getId();

        $this->validate($row);
        $this->persist($row);

        $data = [
            'removed' => [$removedId],
            //'rows'    => [$this->getViewBuilder()->buildRow($row)],
        ];

        return $this->buildResponse($data, self::SERIALIZE_LAYOUT);
    }
public function removeAction ( Request $ request ) { $ block = $ this -> findBlockByRequest ( $ request ) ; $ row = $ block -> getRow ( ) ; try { $ this -> getEditor ( ) -> getBlockManager ( ) -> delete ( $ block ) ; } catch ( EditorExceptionInterface $ e ) { return $ this -> handleException ( $ e ) ; } // Stores id for front removal $ removedId = $ this -> getViewBuilder ( ) -> buildBlock ( $ block ) -> getAttributes ( ) -> getId ( ) ; $ this -> validate ( $ row ) ; $ this -> persist ( $ row ) ; $ data = [ 'removed' => [ $ removedId ] , //'rows'    => [$this->getViewBuilder()->buildRow($row)], ] ; return $ this -> buildResponse ( $ data , self :: SERIALIZE_LAYOUT ) ; }
Removes the block.

@param Request $request

@return Response
Removes the block .