/**
  * @Route("/playlist/{idPlaylist}", name="_commentPlaylist")
  * @Template()
  */
 public function commentAction($idPlaylist)
 {
     $data = [];
     $em = $this->getDoctrine()->getManager();
     $playlistQuery = new PlaylistQuery($em);
     $playlist = $playlistQuery->setId($idPlaylist)->setPrivate(false)->getSingle('playlist_' . $idPlaylist);
     $playlistOwner = $playlistQuery->initQueryBuilder()->setId($idPlaylist)->setUser($this->getUser())->getSingle();
     if (null !== $playlist || null !== $playlistOwner) {
         $playlist = $playlist ? $playlist : $playlistOwner;
         $data['title'] = $playlist->getName() . ' - Playlist';
         if ($this->getRequest()->isXmlHttpRequest()) {
             $data['content'] = $this->renderView('VidlisCoreBundle:Playlist:contentComment.html.twig', $this->contentCommentAction($idPlaylist));
             $response = new Response(json_encode($data));
             $response->headers->set('Content-Type', 'application/json');
             return $response;
         } else {
             $data['idPlaylist'] = $idPlaylist;
         }
     } else {
         return $this->redirect($this->generateUrl('_homePlaylistsAll'));
     }
     return $data;
 }