public function createCatalogAction()
 {
     $em = $this->getDoctrine()->getEntityManager();
     $request = $this->getRequest();
     $catalogName = $request->get('catalogName');
     $catalogCategory = $request->get('catalogCategory');
     $creationDate = $request->get('creationDate');
     $startDate = $request->get('startDate');
     $endDate = $request->get('endDate');
     $start = substr($startDate, 0, 10);
     $end = substr($endDate, 0, 10);
     /////////////////////////////////////////////
     $filename = $_FILES["file"]["name"];
     $name_extension = explode('.', $filename);
     $imageName = $catalogName . '.' . $name_extension[1];
     ///////////////////////////////////////////
     $catalog = new Catalog();
     $catalog->setCatalogName($catalogName);
     $catalog->setCatalogCategory($catalogCategory);
     $catalog->setCreationDate($creationDate);
     $catalog->setStartDate($start);
     $catalog->setEndDate($end);
     $catalog->setNbLikes(0);
     $catalog->setNbViews(0);
     $catalog->setCatalogPhoto($imageName);
     $catalog->setUser($this->getUser());
     $em->persist($catalog);
     $em->flush();
     $this->uploadCatalogPicture($catalogName, $imageName);
     return new JsonResponse($catalog, 200);
 }