Advertisement
Guest User

Untitled

a guest
Oct 5th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. public function createTeam(Request $request)
  2. {
  3. $teamForm = $this->createForm(TeamType::class);
  4.  
  5. $teamForm->handleRequest($request);
  6. if ($teamForm->isSubmitted() && $teamForm->isValid()) {
  7.  
  8. $user = $this->getUser();
  9. $team = $teamForm->getData();
  10.  
  11. $team->setCreatedAt(new DateTime())
  12. ->setCreator($user);
  13.  
  14. $this->em->persist($team);
  15. //dd($team);
  16. $this->em->flush();
  17.  
  18. }
  19.  
  20. TeamController.php on line 52:
  21. Team {#591 ▼
  22. -id: null
  23. -creator: SteamUser {#238 ▼
  24. -id: 1
  25. -roles: array:1 [▶]
  26. -nickName: "steamuser"
  27. -userName: "76561192288153971"
  28. -password: "LrC8fFLuIdPqAiDHDATiheRaIBk="
  29. -avatar: "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/9e/9e8567cc32383f28df41da7fbca7e8afd47f8516.jpg"
  30. -teams: PersistentCollection {#290 ▶}
  31. }
  32. -name: "dasdasdasdas"
  33. -logo: null
  34. -teamType: 2
  35. -createdAt: DateTime {#594 ▶}
  36. -roster: ArrayCollection {#571 ▶}
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement