<commit_before><?php

namespace Cac\UserBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Cac\UserBundle\Entity\Barman;
use Cac\UserBundle\Form\RegistrationBarmanFormType;

/**
 * user reservations controller.
 *
 * @Route("/")
 */
class UserReservationsController extends Controller
{
    /**
     * get past reservation of the user.
     *
     * @Route("/past-reservations", name="past-reservations")
     * @Template()
     */
    public function pastReservationsAction()
    {
        $user = $this->get('security.context')->getToken()->getUser();
        $em = $this->getDoctrine()->getManager();
        $promoOffertes = $em->getRepository('CacBarBundle:PromoOffertes')->findByUser($user);
        return array('promoOffertes' => $promoOffertes);
    }

    /**
     * get past reservation of the user.
     *
     * @Route("/past-invitations", name="past-invitations")
     * @Template()
     */
    public function pastInvitationsAction()
    {
        $user = $this->get('security.context')->getToken()->getUser();
        $em = $this->getDoctrine()->getManager();
        $verresOfferts = $em->getRepository('CacBarBundle:VerresOfferts')->findByUser($user);<commit_msg>find by promo<commit_after><?php

namespace Cac\UserBundle\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Cac\UserBundle\Entity\Barman;
use Cac\UserBundle\Form\RegistrationBarmanFormType;

/**
 * user reservations controller.
 *
 * @Route("/")
 */
class UserReservationsController extends Controller
{
    /**
     * get past reservation of the user.
     *
     * @Route("/past-reservations", name="past-reservations")
     * @Template()
     */
    public function pastReservationsAction()
    {
        $user = $this->get('security.context')->getToken()->getUser();
        $em = $this->getDoctrine()->getManager();
        $promoOffertes = $em->getRepository('CacBarBundle:PromoOffertes')->findBy(array('user'=> $user), array('id' => 'DESC'));
        return array('promoOffertes' => $promoOffertes);
    }

    /**
     * get past reservation of the user.
     *
     * @Route("/past-invitations", name="past-invitations")
     * @Template()
     */
    public function pastInvitationsAction()
    {
        $user = $this->get('security.context')->getToken()->getUser();
        $em = $this->getDoctrine()->getManager();
        $verresOfferts = $em->getRepository('CacBarBundle:VerresOfferts')->findBy(array('user'=> $user), array('id' => 'DESC'));
{'fraction_non_alphanumeric': 0.15572105619498985, 'fraction_numerical': 0.0, 'mean_word_length': 3.966386554621849, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6034724', 'n_tokens_mistral': 886, 'n_tokens_neox': 875, 'n_words': 135}