Last active
November 9, 2018 16:57
-
-
Save lahaxearnaud/4d8e9a4a1ecec3ee8f9e692146db1d41 to your computer and use it in GitHub Desktop.
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
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Symfony\Component\Messenger\MessageBusInterface; | |
use App\Message\ConfirmCommandMailer; | |
class CommandController extends Controller | |
{ | |
/** | |
* @var MessageBusInterface | |
*/ | |
private $bus; | |
/** | |
* CommandController constructor. | |
*/ | |
public function __construct(MessageBusInterface $bus) | |
{ | |
$this->bus = $bus; | |
} | |
/** | |
* @Route("/customer/{idCustomer}/command/{idCommand}/confirm", name="confirm_command", methods={"POST"}) | |
* @param $name | |
*/ | |
public function index($idCustomer, $idCommand) | |
{ | |
// check des params | |
// changement du statut de la commande | |
//... | |
// on envoie notre message dans le broker | |
$this->bus->dispatch(new ConfirmCommandMailer($idCommand)); | |
// rendu du tpl | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment