Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
3.4.4
=====

* (improvement) Add option to `EntityModel::update()` to skip marking the entity as modified.


3.4.3
=====

Expand Down
4 changes: 2 additions & 2 deletions src/Model/EntityModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down