Rename method and variables

[MAILPOET-3533]
This commit is contained in:
Jan Lysý
2021-05-10 10:02:59 +02:00
committed by Veljko V
parent 51dfdc7b69
commit 62cb468525
2 changed files with 6 additions and 6 deletions

View File

@ -103,7 +103,7 @@ class Settings extends APIEndpoint {
public function recalculateSubscribersScore() { public function recalculateSubscribersScore() {
$this->statisticsOpensRepository->resetSubscribersScoreCalculation(); $this->statisticsOpensRepository->resetSubscribersScoreCalculation();
$this->statisticsOpensRepository->resetNewslettersScoreCalculation(); $this->statisticsOpensRepository->resetSegmentsScoreCalculation();
$task = new ScheduledTaskEntity(); $task = new ScheduledTaskEntity();
$task->setType(SubscribersEngagementScore::TASK_TYPE); $task->setType(SubscribersEngagementScore::TASK_TYPE);
$task->setScheduledAt(Carbon::createFromTimestamp($this->wp->currentTime('timestamp'))); $task->setScheduledAt(Carbon::createFromTimestamp($this->wp->currentTime('timestamp')));

View File

@ -55,8 +55,8 @@ class StatisticsOpensRepository extends Repository {
public function resetSubscribersScoreCalculation() { public function resetSubscribersScoreCalculation() {
$this->entityManager->createQueryBuilder()->update(SubscriberEntity::class, 's') $this->entityManager->createQueryBuilder()->update(SubscriberEntity::class, 's')
->set('s.engagementScoreUpdatedAt', ':verified') ->set('s.engagementScoreUpdatedAt', ':updatedAt')
->setParameter('verified', null) ->setParameter('updatedAt', null)
->getQuery()->execute(); ->getQuery()->execute();
} }
@ -103,10 +103,10 @@ class StatisticsOpensRepository extends Repository {
$this->entityManager->flush(); $this->entityManager->flush();
} }
public function resetNewslettersScoreCalculation(): void { public function resetSegmentsScoreCalculation(): void {
$this->entityManager->createQueryBuilder()->update(SegmentEntity::class, 's') $this->entityManager->createQueryBuilder()->update(SegmentEntity::class, 's')
->set('s.averageEngagementScoreUpdatedAt', ':verified') ->set('s.averageEngagementScoreUpdatedAt', ':updatedAt')
->setParameter('verified', null) ->setParameter('updatedAt', null)
->getQuery()->execute(); ->getQuery()->execute();
} }
} }