Guest User

Untitled

a guest
Apr 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.31 KB | None | 0 0
  1. // $em is the entity manager
  2.  
  3. // find takes 2 parameters:
  4. //     1) the entity type you are interested in and
  5. //     2) the entity's primary key
  6. $myUser = $em->find('MyProject\Entity\User', 42);
  7. $myUser->setEmail($newEmail);
  8.  
  9. // flush tells the entity manager to write all changes to the database.
  10. $em->flush();
Add Comment
Please, Sign In to add comment