Skip to content

Instantly share code, notes, and snippets.

View devandclick's full-sized avatar

Catelain Benjamin devandclick

View GitHub Profile
doctrine:
dbal:
driver: "%database_driver%"
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8
listener.user:
class: Utilisateurs/UtilisateursBundle/EventListener/UtilisateurCreationListener
arguments: [@doctrine]
tags:
- { name: kernel.event_listener, event: security.interactive_login, method: onAuthenticationSuccess }
<?php
use Symfony\Component\HttpFoundation\Response;
public function facturesPDFAction($id)
{
$em = $this->getDoctrine()->getManager();
$facture = $em->getRepository('EcommerceBundle:Commandes')->findOneBy(array('utilisateur' => $this->getUser(),
'valider' => 1,
'id' => $id));
use Symfony\Component\HttpFoundation\Response;
public function showFactureAction($id)
{
$em = $this->getDoctrine()->getManager();
$facture = $em->getRepository('EcommerceBundle:Commandes')->find($id);
if (!$facture) {
$this->get('session')->getFlashBag()->add('error', 'Une erreur est survenue');
return $this->redirect($this->generateUrl('adminCommande'));