Files
symfony-notifications/NotificationsBundle/Controller/MainController.php
PaulCombal a98aa394ac auto
2019-03-01 14:20:14 +01:00

19 lines
492 B
PHP

<?php
namespace Bluesquare\NotificationsBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
class MainController extends AbstractController
{
public function myUser()
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');
$notifssrv = $this->get('bluesquare.notifications_bundle.notifssrv');
$user = $this->getUser();
$notifs = $notifssrv->getForUser($user, true);
return $this->json($notifs);
}
}