protected function cloneComponent($data) { $this->componentService->clearSection($data['place'], $data['section']); $newComponentUniqName = $this->componentService->cloneComponentPlace($data['componentId'])->uniqName; foreach ($data['stack'] as &$item) { $item = $item == $data['componentId'] ? $newComponentUniqName : $item; } $this->componentService->saveSectionPositionStack($data['section'], $data['stack']); $this->clearCache($data['place']); return $newComponentUniqName; }