/**
  * @ApiDoc(
  *  description="Restaurant reviewed array of id",
  *  statusCodes={200="Restaurant"},
  *  section="Restaurant",
  *  filters={
  *      {"name"="user", "dataType"="integer", "required"=true}
  *  })
  * @Route("/api/restaurants/reviewed/ids")
  * @Cache(maxage="+1 week", public=true)
  * @Method({"GET"})
  * @throws BadRequestException
  * @return View
  */
 public function getReviewedAction()
 {
     $request = $this->requestStack->getCurrentRequest();
     $userId = $request->query->get('user');
     if (!$userId) {
         throw new BadRequestException();
     }
     $restaurants = $this->reviewRepository->getReviewsIdsOf($userId);
     $this->cacheManager->tagController($request, CacheTag::REVIEW);
     return $this->view(array('restaurants' => $restaurants));
 }
 protected function getRestaurantsIds(Request $request)
 {
     $reviewedBy = $request->query->get('reviewedBy');
     $wishedBy = $request->query->get('wishedBy');
     $results = array();
     if ($reviewedBy && $wishedBy) {
         $wishedRestaurants = $this->wishRepository->getWishesIdsOf($wishedBy);
         $reviewedRestaurants = $this->reviewRepository->getReviewsIdsOf($reviewedBy);
         $results = array_unique(array_merge($wishedRestaurants, $reviewedRestaurants));
     } else {
         if ($reviewedBy) {
             $results = $this->reviewRepository->getReviewsIdsOf($reviewedBy);
         } else {
             if ($wishedBy) {
                 $results = $this->wishRepository->getWishesIdsOf($wishedBy);
             }
         }
     }
     return $results;
 }