/**
  * Get the family collection
  *
  * @param Request $request
  *
  * @return JsonResponse
  */
 public function indexAction(Request $request)
 {
     $options = $request->query->get('options', ['limit' => 20]);
     if ($request->request->has('identifiers')) {
         $options['identifiers'] = explode(',', $request->request->get('identifiers'));
     }
     $families = $this->familySearchableRepo->findBySearch($request->query->get('search'), $options);
     $normalizedFamilies = [];
     foreach ($families as $family) {
         $normalizedFamilies[$family->getCode()] = $this->normalizer->normalize($family, 'json');
     }
     return new JsonResponse($normalizedFamilies);
 }
 /**
  * Get the family collection
  *
  * @param Request $request
  *
  * @return JsonResponse
  */
 public function indexAction(Request $request)
 {
     #TODO: PIM-5194: to rework on master, drop the if condition
     if (null !== $this->familySearchableRepo) {
         $query = $request->query;
         $search = $query->get('search');
         $families = $this->familySearchableRepo->findBySearch($search, $query->get('options', []));
     } else {
         $families = $this->familyRepository->findAll();
     }
     $normalizedFamilies = [];
     foreach ($families as $family) {
         $normalizedFamilies[$family->getCode()] = $this->normalizer->normalize($family, 'json');
     }
     return new JsonResponse($normalizedFamilies);
 }