absenceReader->isUserAbsent($user); if (null === $absence) { return; } if ($absence === $user->isAbsent()) { // nothing to do return; } $this->logger->info("will change user absence", ['userId' => $user->getId()]); if ($absence) { $this->logger->debug("make user absent", ['userId' => $user->getId()]); $user->setAbsenceStart($this->clock->now()); } else { $this->logger->debug("make user present", ['userId' => $user->getId()]); $user->setAbsenceStart(null); } } }