mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 10:33:49 +00:00
privacyEvent, add event in timeline
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
|
||||
namespace Chill\PersonBundle\Controller;
|
||||
|
||||
use Chill\PersonBundle\Privacy\PrivacyEvent;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
@@ -30,7 +32,23 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
*/
|
||||
class TimelinePersonController extends Controller
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @var EventDispatcherInterface
|
||||
*/
|
||||
protected $eventDispatcher;
|
||||
|
||||
/**
|
||||
* TimelinePersonController constructor.
|
||||
*
|
||||
* @param EventDispatcherInterface $eventDispatcher
|
||||
*/
|
||||
public function __construct(EventDispatcherInterface $eventDispatcher)
|
||||
{
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
}
|
||||
|
||||
|
||||
public function personAction(Request $request, $person_id)
|
||||
{
|
||||
$person = $this->getDoctrine()
|
||||
@@ -52,7 +70,10 @@ class TimelinePersonController extends Controller
|
||||
);
|
||||
|
||||
$paginator = $paginatorFactory->create($nbItems);
|
||||
|
||||
|
||||
$event = new PrivacyEvent($person);
|
||||
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
||||
|
||||
return $this->render('ChillPersonBundle:Timeline:index.html.twig', array
|
||||
(
|
||||
'timeline' => $timelineBuilder->getTimelineHTML(
|
||||
|
Reference in New Issue
Block a user