Removes a specific setting for a specific user.
public deletePreference ( |
||
$user | The user to delete the preference for | |
$key | string | The key to delete |
/** * Retrieves a collection of resources. * * @param Request $request * * @throws \Exception If the format is invalid * @throws RuntimeException|RootNodeNotFoundException * * @return array|\Dunglas\ApiBundle\Model\PaginatorInterface|\Traversable */ public function __invoke(Request $request) { $user = $this->userService->getUser(); if ($request->request->has('preferenceKey')) { $this->userPreferenceService->deletePreference($user, $request->request->get('preferenceKey')); } else { throw new \Exception('Invalid format'); } }