Bundle/WidgetMapBundle/Manager/WidgetMapManager.php
protected function cloneWidgetMap(WidgetMap $widgetMap, View $view)
    {
        $originalWidgetMap = $widgetMap;
        $widgetMap = clone $widgetMap;
        $widgetMap->setId(null);
        $widgetMap->setAction(WidgetMap::ACTION_OVERWRITE);
        $widgetMap->setReplaced($originalWidgetMap);
        $widgetMap->setView($view);
        $view->addWidgetMap($widgetMap);
        $this->em->persist($widgetMap);

        return $widgetMap;
    }
protected function cloneWidgetMap(WidgetMap $widgetMap, View $view)
    {
        $originalWidgetMap = $widgetMap;
        $widgetMap = clone $widgetMap;
        $widgetMap->setId(null);
        $widgetMap->setAction(WidgetMap::ACTION_OVERWRITE);
        $widgetMap->setReplaced($originalWidgetMap);
        $widgetMap->setView($view);
        $view->addWidgetMap($widgetMap);
        $this->em->persist($widgetMap);

        return $widgetMap;
    }
protected function cloneWidgetMap ( WidgetMap $ widgetMap , View $ view ) { $ originalWidgetMap = $ widgetMap ; $ widgetMap = clone $ widgetMap ; $ widgetMap -> setId ( null ) ; $ widgetMap -> setAction ( WidgetMap :: ACTION_OVERWRITE ) ; $ widgetMap -> setReplaced ( $ originalWidgetMap ) ; $ widgetMap -> setView ( $ view ) ; $ view -> addWidgetMap ( $ widgetMap ) ; $ this -> em -> persist ( $ widgetMap ) ; return $ widgetMap ; }
Create a copy of a WidgetMap in "overwrite" mode and insert it in the given view.

@param WidgetMap $widgetMap
@param View      $view

@throws \Exception

@return WidgetMap
Create a copy of a WidgetMap in overwrite mode and insert it in the given view .