Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @param Request $request
- * @param int $id
- *
- * @return mixed
- */
- public function postBikeStatusAction(Request $request,$id)
- {
- try {
- $status = $this->getHandler()->postStatus($this->getRide($id), $request->request->all());
- $routeOptions = [
- 'id' => $location->getRide()->getId(),
- ];
- return $this->routeRedirectView('get_users_rides', $routeOptions, Response::HTTP_CREATED);
- } catch (InvalidFormException $e) {
- return $e->getForm();
- }
- }
- *********************************************************
- /**
- * @param Status $resource
- * @param array $parameters
- * @param array $options
- *
- * @return Status
- */
- public function postStatus($resource,array $parameters, array $options = [])
- {
- $this->guardObjectImplementsInterface($resource);
- $status = $this->formHandler->handleFinish(
- $resource,
- $parameters,
- Request::METHOD_POST,
- $options
- );
- if ($status->getStatus() === false)
- {
- $resource->getBike()->setBreakdown(false);
- }
- $this->repository->save($status);
- return $status;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement