domainRepository->findOneBy(['ldhName' => $ldhName]); // If the domain name exists in the database, recently updated and not important, we return the stored Domain if (null !== $domain && !$domain->getDeleted() && ($domain->getUpdatedAt()->diff(new \DateTimeImmutable('now'))->days < 7) && !$this->RDAPService::isToBeWatchClosely($domain, $domain->getUpdatedAt()) ) { return $domain; } if (false === $kernel->isDebug()) { $limiter = $this->authenticatedApiLimiter->create($this->getUser()->getUserIdentifier()); if (false === $limiter->consume()->isAccepted()) { throw new TooManyRequestsHttpException(); } } $updatedAt = null === $domain ? new \DateTimeImmutable('now') : $domain->getUpdatedAt(); $domain = $this->RDAPService->registerDomain($ldhName); /** @var WatchList $watchList */ foreach ($domain->getWatchLists()->getIterator() as $watchList) { $this->bus->dispatch(new ProcessDomainTrigger($watchList->getToken(), $domain->getLdhName(), $updatedAt)); } return $domain; } }