mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
prevent change when syncing from remote
This commit is contained in:
parent
64e07c54fa
commit
6e48a042b3
@ -11,7 +11,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\CalendarBundle\RemoteCalendar\Connector\MSGraph\RemoteToLocalSync;
|
||||
|
||||
use Chill\CalendarBundle\Entity\Calendar;
|
||||
use Chill\CalendarBundle\Entity\CalendarRange;
|
||||
use Chill\CalendarBundle\RemoteCalendar\Connector\MSGraph\MachineHttpClient;
|
||||
use Chill\CalendarBundle\RemoteCalendar\Connector\MSGraph\RemoteEventConverter;
|
||||
@ -53,6 +52,7 @@ class CalendarRangeSyncer
|
||||
if (null !== $calendarRange->getCalendar()) {
|
||||
return;
|
||||
}
|
||||
$calendarRange->preventEnqueueChanges = true;
|
||||
|
||||
$this->logger->info(__CLASS__ . ' remove a calendar range because deleted on remote calendar');
|
||||
$this->em->remove($calendarRange);
|
||||
@ -91,7 +91,9 @@ class CalendarRangeSyncer
|
||||
->addRemoteAttributes([
|
||||
'lastModifiedDateTime' => $lastModified->getTimestamp(),
|
||||
'changeKey' => $new['changeKey'],
|
||||
]);
|
||||
])
|
||||
->preventEnqueueChanges = true
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -167,6 +167,7 @@ JSON;
|
||||
$calendarRange->getStartDate()->format(\DateTimeImmutable::ATOM));
|
||||
$this->assertStringContainsString('2022-06-10T17:30:00',
|
||||
$calendarRange->getEndDate()->format(\DateTimeImmutable::ATOM));
|
||||
$this->assertTrue($calendarRange->preventEnqueueChanges);
|
||||
}
|
||||
|
||||
public function testDeleteCalendarRangeWithoutAssociation(): void
|
||||
@ -194,6 +195,7 @@ JSON;
|
||||
$calendarRange,
|
||||
$notification['value'][0],
|
||||
$user);
|
||||
$this->assertTrue($calendarRange->preventEnqueueChanges);
|
||||
}
|
||||
|
||||
public function testDeleteCalendarRangeWithAssociation(): void
|
||||
@ -224,5 +226,6 @@ JSON;
|
||||
$calendarRange,
|
||||
$notification['value'][0],
|
||||
$user);
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user