projectRepository = $projectRepository; $this->workflowProjectRepository = $workflowProjectRepository; $this->placesRepository = $placesRepository; $this->transitionsRepository = $transitionsRepository; $this->configuration = $configuration; $this->module = $module; $this->registry = $registry; $this->pageRepository = $pageRepository; } /* * Récupèration de l'étape du project dans le workflow */ public function getPlace(int $id) { $place = $this->projectRepository->getPlace($id); return $place['currentPlace']; } public function removePlace(int $place_id) { $place = $this->placesRepository->findById($place_id); $pages = $this->pageRepository->findByPlace($place->getKey()); $transitionReject = $this->transitionsRepository->findRejectByPlace($place->getId(), $this->module->getModule()); $statusView = null; if (!empty($transitionReject) && !empty($pages)) { foreach ($pages as $page) { $statusView = new StatusView( $page->getId(), $transitionReject->getKey() ); $this->registry->applyStatusPage($statusView, $place->getConfiguration()->getId(), null, "remove step"); if(!empty($page->getPageDuplicates())){ foreach ($page->getPageDuplicates() as $dupli) { if($dupli->getCurrentPlace() === $place->getKey()){ $this->registry->applyStatusPage($statusView, $place->getConfiguration()->getId(), $dupli->getId(), "remove step"); } } } } } return true; } public function changePlaceKey($configView, array $places) { $clear = new ClearService(); if ($configView->id) { $configuration = $this->configuration->findById($configView->id); foreach ($places as $place) { $key = $clear->cleanString($place->nom) . '_' . $configuration->getGenericKey(); $this->projectRepository->resetCurrentPlace($place->id, $key); } } } }