Bundle/WidgetBundle/Model/WidgetManager.php
public function overwriteWidget(View $view, Widget $widget)
    {
        $widgetCopy = $this->cloneEntity($widget);
        $originalWidgetMap = $widget->getWidgetMap();
        $this->widgetMapManager->overwrite($view, $originalWidgetMap, $widgetCopy);

        return $widgetCopy;
    }
public function overwriteWidget(View $view, Widget $widget)
    {
        $widgetCopy = $this->cloneEntity($widget);
        $originalWidgetMap = $widget->getWidgetMap();
        $this->widgetMapManager->overwrite($view, $originalWidgetMap, $widgetCopy);

        return $widgetCopy;
    }
public function overwriteWidget ( View $ view , Widget $ widget ) { $ widgetCopy = $ this -> cloneEntity ( $ widget ) ; $ originalWidgetMap = $ widget -> getWidgetMap ( ) ; $ this -> widgetMapManager -> overwrite ( $ view , $ originalWidgetMap , $ widgetCopy ) ; return $ widgetCopy ; }
Overwrite the widget for the current view because the widget is not linked to the current view, a copy is created.

@param View   $view
@param Widget $widget

@throws \Exception The slot does not exists

@return Widget The widget
Overwrite the widget for the current view because the widget is not linked to the current view a copy is created .