/**
  * Update sorting of the options
  *
  * @param Request $request
  * @param int     $attributeId
  *
  * @return JsonResponse
  *
  * @AclAncestor("pim_enrich_attribute_edit")
  */
 public function updateSortingAction(Request $request, $attributeId)
 {
     $attribute = $this->findAttributeOr404($attributeId);
     //Should be replaced by a paramConverter
     $data = json_decode($request->getContent(), true);
     $sorting = array_flip($data);
     $this->attributeManager->updateSorting($attribute, $sorting);
     return new JsonResponse();
 }