Created
May 12, 2020 19:31
-
-
Save anvodev/d3cdd748927ebc1c073b9acc52cc4e46 to your computer and use it in GitHub Desktop.
Determine how ID is generated
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //src/Doctrine/CustomerIdGenerator.php | |
| namespace App\Doctrine; | |
| use Doctrine\ORM\EntityManager; | |
| use Doctrine\ORM\Id\AbstractIdGenerator; | |
| class CustomerIdGenerator extends AbstractIdGenerator | |
| { | |
| public function generate(EntityManager $em, $entity) | |
| { | |
| return random_int(200000, 899999); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment