Beispiel #1
0
 public function getData()
 {
     $params = array();
     $params['clubs'] = $clubs = $this->clubManager->getAll();
     $params['cities'] = $this->cityManager->getAll();
     $params['positions'] = Positions::getPossibleValues();
     return $params;
 }
Beispiel #2
0
 function edit($request)
 {
     $response = new JsonResponse();
     $id = $request->request->get('id');
     $object = $this->repository->getOneById($id);
     if ($object == null) {
         $response->setData(array('flag' => false, 'info' => "Error! No object for given id"));
         return $response;
     }
     $homeClub = $this->clubManager->getOneById($request->request->get('homeClubId'));
     $awayClub = $this->clubManager->getOneById($request->request->get('awayClubId'));
     $date = $request->request->get('date');
     //        $competitionId  = $request->request->get('competitonId');
     $competition = $this->competitionManager->getOneById(1);
     $object->setAwayClub($awayClub)->setHomeClub($homeClub)->setStartTime($date)->setCompetition($competition);
     $this->repository->flush();
     $response->setData(array('flag' => true, 'info' => "ok"));
     return $response;
 }