Skip to content

Commit

Permalink
Assign new created time only if there is no other time yet set
Browse files Browse the repository at this point in the history
  • Loading branch information
juniwalk committed May 12, 2024
1 parent b377276 commit 8acd0e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Entity/Traits/Timestamp.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ trait Timestamp

public function setCreated(DateTimeInterface $created): void
{
$this->created = DateTime::createFromInterface($created);
$this->created ??= DateTime::createFromInterface($created);
}


Expand Down

0 comments on commit 8acd0e7

Please sign in to comment.