Guest User

Untitled

a guest
Mar 19th, 2015
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. namespace Application\Controller;
  2.  
  3. use Zend\Mvc\Controller\AbstractActionController;
  4. use Zend\View\Model\ViewModel;
  5. use Application\Entity;
  6.  
  7. class IndexController extends AbstractActionController
  8. {
  9. public function indexAction()
  10. {
  11. $objectManager = $this->getServiceLocator()
  12. ->get('Doctrine\ORM\EntityManager');
  13.  
  14. $user = new Application\Entity\User();
  15. $user->setFullName("Beni Gheorghita");
  16.  
  17. $objectManager->persist($user);
  18. $objectManager->flush();
  19.  
  20. die(var_dump($user->getId()));
  21.  
  22. return new ViewModel();
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment