validGetParameterService->hasParameter(FrameParameter::getKey())) { return $this->validGetParameterService->getParameter(FrameParameter::getKey()); } return true; } /** * Don't know if this function will be usefull in the future. * Feel free to remove it if this should not be the case. * * @todo Implement tests * * @return string The general entity template or a individual template if it is set */ private function getTemplate(): string { if ($this->checkLoadWithFrame()) { if ($this->templateNameService->doesMoleculeTemplateExist()) { return $this->templateNameService->getMoleculeTemplateName(); } return self::TWIG_ENTITY_MOLECULE_TEMPLATE_PATH; } if ($this->templateNameService->doesAtomTemplateExist()) { return $this->templateNameService->getAtomTemplateName(); } return self::TWIG_ENTITY_ATOM_TEMPLATE_PATH; } /** * @param ActionServiceInterface $actionService * @param ActionFactoryServiceInterface $actionFactoryService */ public function __construct(ActionServiceInterface $actionService, ActionFactoryServiceInterface $actionFactoryService, TemplateNameServiceInterface $templateNameService, ValidGetParameterServiceInterface $validGetParameterService) { $this->view = View::create(); $this->actionService = $actionService; $this->templateNameService = $templateNameService; $this->validGetParameterService = $validGetParameterService; } /** * @return View */ public function getView(): View { $template = $this->getTemplate(); $this->view->setTemplate($template); return $this->view; } }