Skip to content

Instantly share code, notes, and snippets.

@JCook21
Last active December 12, 2015 09:59
Show Gist options
  • Save JCook21/4755846 to your computer and use it in GitHub Desktop.
Save JCook21/4755846 to your computer and use it in GitHub Desktop.
public function putBioAction(Team $team, TeamMember $teamMember, MemberBio $bio, Request $request)
{
if (! self::validateTeamMemberForTeam($team, $teamMember) || $bio->getTeamMember() !== $teamMember) {
throw $this->createNotFoundException('Invalid team member for team or bio for team member');
}
$form = $this->createForm(new BioType, $bio);
$form->bind($request);
if (! $form->isValid()) {
return $form;
}
$this->entityManager->flush();
return array(
'message' => 'Bio successfully updated'
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment