Bundle/CoreBundle/Twig/Extension/CmsExtension.php
public function cmsWidgetUnlinkAction($widgetId, $view)
    {
        $viewReference = $this->viewReferenceRepository->getOneReferenceByParameters(
            ['viewId' => $view->getId()]
        );
        if (!$viewReference && $view->getId() != '') {
            $viewReference = new ViewReference($view->getId());
        } elseif ($view instanceof VirtualBusinessPage) {
            $viewReference = new ViewReference($view->getTemplate()->getId());
        }

        $view->setReference($viewReference);

        return $this->widgetRenderer->renderUnlinkActionByWidgetId($widgetId, $view);
    }
public function cmsWidgetUnlinkAction($widgetId, $view)
    {
        $viewReference = $this->viewReferenceRepository->getOneReferenceByParameters(
            ['viewId' => $view->getId()]
        );
        if (!$viewReference && $view->getId() != '') {
            $viewReference = new ViewReference($view->getId());
        } elseif ($view instanceof VirtualBusinessPage) {
            $viewReference = new ViewReference($view->getTemplate()->getId());
        }

        $view->setReference($viewReference);

        return $this->widgetRenderer->renderUnlinkActionByWidgetId($widgetId, $view);
    }
public function cmsWidgetUnlinkAction ( $ widgetId , $ view ) { $ viewReference = $ this -> viewReferenceRepository -> getOneReferenceByParameters ( [ 'viewId' => $ view -> getId ( ) ] ) ; if ( ! $ viewReference && $ view -> getId ( ) != '' ) { $ viewReference = new ViewReference ( $ view -> getId ( ) ) ; } elseif ( $ view instanceof VirtualBusinessPage ) { $ viewReference = new ViewReference ( $ view -> getTemplate ( ) -> getId ( ) ) ; } $ view -> setReference ( $ viewReference ) ; return $ this -> widgetRenderer -> renderUnlinkActionByWidgetId ( $ widgetId , $ view ) ; }
render unlink action for a widgetId.

@param int $widgetId The widgetId to unlink

@return string the widget unlink action
render unlink action for a widgetId .