Skip to content

Commit

Permalink
Update baseObjectMethodHook.php
Browse files Browse the repository at this point in the history
add microtime for primary key
  • Loading branch information
abolfazl-esmaeeli authored Nov 19, 2024
1 parent 44fef82 commit 72c0e09
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions templates/Builder/Om/baseObjectMethodHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ public function preSave(?ConnectionInterface $con = null): bool
return parent::preSave($con);
}
<?php endif?>
if ($this->isNew() && !$this->getId()) {
$this->setId((int) (microtime(true) * 1000000));
}
return true;
}

Expand Down

0 comments on commit 72c0e09

Please sign in to comment.