|
@@ -5,6 +5,7 @@ namespace AppBundle\Controller;
|
|
|
use AppBundle\Entity\Commentaire;
|
|
|
use AppBundle\Entity\Genre;
|
|
|
use AppBundle\Entity\Realisateur;
|
|
|
+use AppBundle\Service\Mattermost;
|
|
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
|
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
|
@@ -69,7 +70,7 @@ class VideothequeController extends Controller
|
|
|
/**
|
|
|
* @Route("/ajouter", name="videotheque_ajouter")
|
|
|
*/
|
|
|
- public function ajouterAction(Request $request)
|
|
|
+ public function ajouterAction(Request $request, Mattermost $mattermost)
|
|
|
{
|
|
|
$film = new Film;
|
|
|
$film->setAuthered($this->getUser());
|
|
@@ -84,8 +85,7 @@ class VideothequeController extends Controller
|
|
|
$em->persist($film);
|
|
|
$em->flush();
|
|
|
$this->addFlash('success', 'Le film a été ajouté');
|
|
|
- $notifMattermost = $this->get('film.mattermost');
|
|
|
- $notifMattermost->sendNouveauFilm($film);
|
|
|
+ $mattermost->sendNouveauFilm($film);
|
|
|
return $this->redirectToRoute('videotheque_voirfilm', array('id'=>$film->getId()));
|
|
|
}
|
|
|
|