Skip to content

Commit 7205028

Browse files
authored
Merge pull request #55 from 21TORR/skip-mark-as-modified
Add option to `EntityModel::update()` to skip marking the entity as mo…
2 parents 8825a58 + d26899c commit 7205028

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
3.4.4
2+
=====
3+
4+
* (improvement) Add option to `EntityModel::update()` to skip marking the entity as modified.
5+
6+
17
3.4.3
28
=====
39

src/Model/EntityModel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ public function add (EntityInterface $entity) : static
2626
/**
2727
* @inheritDoc
2828
*/
29-
public function update (EntityInterface $entity) : static
29+
public function update (EntityInterface $entity, bool $markAsModified = true) : static
3030
{
3131
// automatic integration for entities that use the TimestampsTrait
32-
if (method_exists($entity, 'markAsModified'))
32+
if ($markAsModified && method_exists($entity, 'markAsModified'))
3333
{
3434
$entity->markAsModified();
3535
}

0 commit comments

Comments
 (0)