Created
February 10, 2017 09:17
-
-
Save mneuhaus/5fa74b5d358e4ef59e58ddef3c1d735d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ApiController { | |
/** | |
* @Route("/api/search") | |
*/ | |
public function searchAction(Request $request){ | |
$request->get('value'); | |
...do a search... | |
} | |
/** | |
* @Route("/api/teams") | |
*/ | |
public function teamsAction($id, Request $request){ | |
...get all teams... | |
} | |
/** | |
* @Route("/api/teams/{teamId}/add/{memberId}") | |
*/ | |
public function addMemberToTeamAction($teamId, $memberId, Request $request){ | |
$team = $this->teamRepository->findOneById($teamId); | |
$member = $this->teamRepository->findOneById($memberId); | |
$team->addMember($member); | |
$manager->persist($team); | |
$manager->flush(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment