/** * @param Role $role * @param $limit */ public function increaseRoleMaxUsers(Role $role, $limit) { $role->setMaxUsers($role->getMaxUsers() + $limit); $this->om->persist($role); $this->om->flush(); }
/** * @EXT\Route( * "role/{role}/edit/name/{name}", * name="platform_role_name_edit", * options={"expose"=true} * ) * @EXT\Method("POST") * * @param Role $role * @return JsonResponse */ public function editRoleNameAction(Role $role, $name) { if (ctype_space($name)) { return new JsonResponse(array('name' => $role->getName(), 'limit' => $role->getMaxUsers(), 'translationKey' => $role->getTranslationKey()), 500); } $role->setTranslationKey($name); $this->roleManager->edit($role); return new JsonResponse(array('name' => $role->getName(), 'limit' => $role->getMaxUsers(), 'translationKey' => $role->getTranslationKey())); }