From 303d73e65e22fdf7ef4e54c7878442d4054d56b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Gangloff?= Date: Sat, 7 Dec 2024 20:18:49 +0100 Subject: [PATCH] fix: conditions to update a domain name --- src/Entity/Domain.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Entity/Domain.php b/src/Entity/Domain.php index 83a88eb..384f179 100644 --- a/src/Entity/Domain.php +++ b/src/Entity/Domain.php @@ -368,12 +368,11 @@ class Domain { return $this->getUpdatedAt() ->diff(new \DateTimeImmutable())->days >= 7 - || ( - ($fromUser || ($this->getUpdatedAt() - ->diff(new \DateTimeImmutable())->h * 60 + $this->getUpdatedAt() - ->diff(new \DateTimeImmutable())->i) >= 50) - && $this->isToBeWatchClosely() - ) + || (($fromUser || ($this->getUpdatedAt() + ->diff(new \DateTimeImmutable())->h * 60 + $this->getUpdatedAt() + ->diff(new \DateTimeImmutable())->i) >= 50) + && $this->isToBeWatchClosely()) + || (count(array_intersect($this->getStatus(), ['auto renew period', 'client hold', 'server hold'])) > 0 && $this->getUpdatedAt()->diff(new \DateTimeImmutable())->days >= 1); }