From d26899c9133e5b9e1e9832cc6e7cdc1a1a2b1b63 Mon Sep 17 00:00:00 2001 From: Jannik Zschiesche Date: Fri, 23 Jan 2026 18:43:48 +0100 Subject: [PATCH] Add option to `EntityModel::update()` to skip marking the entity as modified --- CHANGELOG.md | 6 ++++++ src/Model/EntityModel.php | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a44157d..ff8b9a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +3.4.4 +===== + +* (improvement) Add option to `EntityModel::update()` to skip marking the entity as modified. + + 3.4.3 ===== diff --git a/src/Model/EntityModel.php b/src/Model/EntityModel.php index a06e87e..1546fdf 100644 --- a/src/Model/EntityModel.php +++ b/src/Model/EntityModel.php @@ -26,10 +26,10 @@ public function add (EntityInterface $entity) : static /** * @inheritDoc */ - public function update (EntityInterface $entity) : static + public function update (EntityInterface $entity, bool $markAsModified = true) : static { // automatic integration for entities that use the TimestampsTrait - if (method_exists($entity, 'markAsModified')) + if ($markAsModified && method_exists($entity, 'markAsModified')) { $entity->markAsModified(); }