This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TaskListener | |
{ | |
private $redis; | |
public function __construct(\Redis $redis) | |
{ | |
$this->redis = $redis; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function createTask( | |
Request $request, | |
Security $security, | |
FormFactory $formFactory, | |
Session $session, | |
RouterInterface $router, | |
TaskHandler $taskHandler | |
): Response { | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class Handler | |
{ | |
protected $form; | |
protected $formFactory; | |
protected $data; | |
protected $request; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @Route("/tasks/create", name="task_create") | |
* @param Request $request | |
* @param Security $security | |
* @param FormFactory $formFactory | |
* @param Session $session | |
* @param RouterInterface $router | |
* @return RedirectResponse|Response | |
*/ | |
public function createTask( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @Route("/tasks/{id}/edit", name="task_edit") | |
* @param Task $task | |
* @param Request $request | |
* @param FormFactory $formFactory | |
* @param Session $session | |
* @param RouterInterface $router | |
* @return RedirectResponse|Response | |
*/ | |
public function editTask(Task $task, Request $request, FormFactory $formFactory, Session $session, RouterInterface $router) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @Route("/tasks/create", name="task_create") | |
* @param Request $request | |
* @param Security $security | |
* @param FormFactory $formFactory | |
* @param Session $session | |
* @param RouterInterface $router | |
* @return RedirectResponse|Response | |
*/ | |
public function createTask( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @Route("/tasks", name="task_list") | |
* @return \Symfony\Component\HttpFoundation\Response | |
*/ | |
public function listTask(Twig_Environment $twig, EntityManager $manager) | |
{ | |
return new Response($twig->render('task/list.html.twig', ['tasks' => $manager | |
//->getDoctrine() | |
->getRepository('AppBundle:Task') | |
->findAll()])); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace AppBundle\Controller; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
/** | |
* Class DefaultController | |
* @package AppBundle\Controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function canDelete(Task $task, User $user) | |
{ | |
/* | |
if($task->getUser() == 'Anonyme' && $user->getRoles() == array('ROLE_ADMIN') || $task->getUser() == $user->getUsername()){ | |
return $user === $task->getUser(); | |
} | |
*/ | |
if($task->getUser() == 'Anonyme' && $user->getRoles() == array('ROLE_ADMIN')){ | |
dump('je supprime quand meme'); | |
die(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Created by Nicolas Dirollo. | |
* Date: 17/01/2019 | |
* Time: 15:51 | |
* @package Symfony | |
* @author Nicolas Dirollo | |
* @copyright 2019 ND | |
* @license * | |
*/ |
NewerOlder