protected function handleView(View $view)
 {
     $handler = $this->get('fos_rest.view_handler');
     $context = $view->getSerializationContext();
     if ($groups = $this->config->getSerializationGroups()) {
         $context->setGroups($groups);
     }
     if ($version = $this->config->getSerializationVersion()) {
         $context->setVersion($version);
     }
     return $handler->handle($view);
 }