public function getData() { $params = array(); $params['clubs'] = $clubs = $this->clubManager->getAll(); $params['cities'] = $this->cityManager->getAll(); $params['positions'] = Positions::getPossibleValues(); return $params; }
function edit(Club $club) { $response = new JsonResponse(); $object = $this->repository->getOneById($club->getId()); if ($object == null) { $response->setData(array('flag' => false, 'info' => "Error! No object for given id")); return $response; } $city = $this->cityManager->getOneById($club->getCity()->getId()); $object->setCity($city); $object->setName($club->getName()); $this->repository->flush(); $response->setData(array('flag' => true, 'info' => "ok")); return $response; }