public function getWorkspaceOptions(Workspace $workspace) { $workspaceOptions = $this->workspaceOptionsRepo->findOneByWorkspace($workspace); if (is_null($workspaceOptions)) { $workspaceOptions = new WorkspaceOptions(); $workspaceOptions->setWorkspace($workspace); $details = array('hide_tools_menu' => false, 'background_color' => null); $workspaceOptions->setDetails($details); $workspace->setOptions($workspaceOptions); $this->om->persist($workspaceOptions); $this->om->persist($workspace); $this->om->flush(); } return $workspaceOptions; }
private function duplicateWorkspaceOptions(Workspace $source, Workspace $workspace) { $sourceOptions = $source->getOptions(); if (!is_null($sourceOptions)) { $options = new WorkspaceOptions(); $options->setWorkspace($workspace); $details = $sourceOptions->getDetails(); if (!is_null($details)) { $details['use_workspace_opening_resource'] = false; $details['workspace_opening_resource'] = null; } $options->setDetails($details); $workspace->setOptions($options); $this->om->persist($options); $this->om->persist($workspace); $this->om->flush(); } }