Skip to content

Commit 72c0e09

Browse files
Update baseObjectMethodHook.php
add microtime for primary key
1 parent 44fef82 commit 72c0e09

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

templates/Builder/Om/baseObjectMethodHook.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ public function preSave(?ConnectionInterface $con = null): bool
1212
return parent::preSave($con);
1313
}
1414
<?php endif?>
15+
if ($this->isNew() && !$this->getId()) {
16+
$this->setId((int) (microtime(true) * 1000000));
17+
}
1518
return true;
1619
}
1720

0 commit comments

Comments
 (0)