Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // $em is the entity manager
- // find takes 2 parameters:
- // 1) the entity type you are interested in and
- // 2) the entity's primary key
- $myUser = $em->find('MyProject\Entity\User', 42);
- $myUser->setEmail($newEmail);
- // flush tells the entity manager to write all changes to the database.
- $em->flush();
Add Comment
Please, Sign In to add comment