Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //the column "externalUserId" should be unique, but how to do it with doctrine?
- //when calling this a new user record with externalUserId=4711 will be created
- $myUser = new myUser();
- $myUser->externalUserId = 4711;
- $myUser->save();
- //when calling this a second user record with externalUserId=4711 will be created
- $myUser = new myUser();
- $myUser->externalUserId = 4711;
- $myUser->save();
- //the second call should throw an exception "Can not create this user.
- //User is already there.
- //Please load the user details and change that user if you want to change the user."
Add Comment
Please, Sign In to add comment