/**
  * @param Request $request
  *
  * @return array
  */
 public function getAll(Request $request)
 {
     $wish = $request->query->get('wish') === 'true';
     $withWish = $request->query->get('withWish') === 'true';
     $restaurantsIds = $this->getRestaurantsIds($request);
     if ($wish) {
         $data = $this->wishRepository->getDataForFlags($request, $restaurantsIds);
         $flags = $this->dataToFlags($data, false);
     } else {
         $data = $this->reviewRepository->getDataForFlags($request, $restaurantsIds);
         $flags = $this->dataToFlags($data, true);
     }
     if ($withWish) {
         $data = $this->wishRepository->getDataForFlags($request, $restaurantsIds);
         $wishFlags = $this->dataToFlags($data, false);
         $flags = $this->mergeFlagsAndWishes($wishFlags, $flags);
     }
     $this->sortFlags($flags, $request);
     return $flags;
 }