Loading module/Oscar/src/Oscar/Service/ProjectGrantService.php +35 −0 Original line number Diff line number Diff line Loading @@ -2117,6 +2117,16 @@ class ProjectGrantService implements UseGearmanJobLauncherService, UseOscarConfi $this->getSearchEngineStrategy()->addActivity($activity); } public function searchIndex_rebuildProject() { // PROJETS $projects = $this->getEntityManager()->getRepository(Project::class)->findAll(); $this->getLoggerService()->info('[elasic] Reindex ' . count($projects) . ' project(s)'); $this->getSearchEngineProjectStrategy()->rebuildIndex($projects); } /** * Retourne les jalons de l'activité. * Loading Loading @@ -2158,6 +2168,24 @@ class ProjectGrantService implements UseGearmanJobLauncherService, UseOscarConfi return true; } public function getSearchEngineProjectStrategy() { static $searchStrategy; if ($searchStrategy === null) { $opt = $this->getOscarConfigurationService()->getConfiguration('strategy.activity.search_engine'); $params = $opt['params']; $params[] = $this->getLoggerService(); $class = new \ReflectionClass(ProjectElasticSearch::class); $searchStrategy = $class->newInstanceArgs($params); $searchStrategy->staticDatas = [ 'typesChainIds' => $this->getActivityTypeService()->getIdsTreeByLast(), 'typesChainlabels' => $this->getActivityTypeService()->getIdsTreeByLast(true), ]; } return $searchStrategy; } /** * @return IActivitySearchStrategy Loading @@ -2171,7 +2199,14 @@ class ProjectGrantService implements UseGearmanJobLauncherService, UseOscarConfi $params[] = $this->getLoggerService(); $class = new \ReflectionClass($opt['class']); $searchStrategy = $class->newInstanceArgs($params); if ($searchStrategy instanceof ElasticActivitySearch) { $searchStrategy->staticDatas = [ 'typesChainIds' => $this->getActivityTypeService()->getIdsTreeByLast(), 'typesChainlabels' => $this->getActivityTypeService()->getIdsTreeByLast(true), ]; } } return $searchStrategy; } Loading Loading
module/Oscar/src/Oscar/Service/ProjectGrantService.php +35 −0 Original line number Diff line number Diff line Loading @@ -2117,6 +2117,16 @@ class ProjectGrantService implements UseGearmanJobLauncherService, UseOscarConfi $this->getSearchEngineStrategy()->addActivity($activity); } public function searchIndex_rebuildProject() { // PROJETS $projects = $this->getEntityManager()->getRepository(Project::class)->findAll(); $this->getLoggerService()->info('[elasic] Reindex ' . count($projects) . ' project(s)'); $this->getSearchEngineProjectStrategy()->rebuildIndex($projects); } /** * Retourne les jalons de l'activité. * Loading Loading @@ -2158,6 +2168,24 @@ class ProjectGrantService implements UseGearmanJobLauncherService, UseOscarConfi return true; } public function getSearchEngineProjectStrategy() { static $searchStrategy; if ($searchStrategy === null) { $opt = $this->getOscarConfigurationService()->getConfiguration('strategy.activity.search_engine'); $params = $opt['params']; $params[] = $this->getLoggerService(); $class = new \ReflectionClass(ProjectElasticSearch::class); $searchStrategy = $class->newInstanceArgs($params); $searchStrategy->staticDatas = [ 'typesChainIds' => $this->getActivityTypeService()->getIdsTreeByLast(), 'typesChainlabels' => $this->getActivityTypeService()->getIdsTreeByLast(true), ]; } return $searchStrategy; } /** * @return IActivitySearchStrategy Loading @@ -2171,7 +2199,14 @@ class ProjectGrantService implements UseGearmanJobLauncherService, UseOscarConfi $params[] = $this->getLoggerService(); $class = new \ReflectionClass($opt['class']); $searchStrategy = $class->newInstanceArgs($params); if ($searchStrategy instanceof ElasticActivitySearch) { $searchStrategy->staticDatas = [ 'typesChainIds' => $this->getActivityTypeService()->getIdsTreeByLast(), 'typesChainlabels' => $this->getActivityTypeService()->getIdsTreeByLast(true), ]; } } return $searchStrategy; } Loading