FormExtension.php 8.42 KB
Newer Older
Julien Jorry committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
<?php

namespace App\Twig;

use App\Entity\User;
use Twig\Extension\AbstractExtension;

/**
 * Fonctions twig permettant d'accéder aux formulaires du Kohinos.
 *
 * @TODO : a refactoriser !
 */
class FormExtension extends AbstractExtension
{
    public $container;

    public function __construct($container)
    {
        $this->container = $container;
    }

    public function getFunctions()
    {
        return [
            new \Twig_SimpleFunction('getUserInfosForm', [$this, 'getUserInfosForm']),
            new \Twig_SimpleFunction('getUserPasswordForm', [$this, 'getUserPasswordForm']),
            new \Twig_SimpleFunction('getGroupeInfosForm', [$this, 'getGroupeInfosForm']),
            new \Twig_SimpleFunction('getComptoirInfosForm', [$this, 'getComptoirInfosForm']),
            new \Twig_SimpleFunction('getPrestataireInfosForm', [$this, 'getPrestataireInfosForm']),
            new \Twig_SimpleFunction('getAdherentInfosForm', [$this, 'getAdherentInfosForm']),
            new \Twig_SimpleFunction('getGroupePrestataireInscriptionForm', [$this, 'getGroupePrestataireInscriptionForm']),
            new \Twig_SimpleFunction('getTransactionAdherentAdherentForm', [$this, 'getTransactionAdherentAdherentForm']),
            new \Twig_SimpleFunction('getTransactionAdherentPrestataireForm', [$this, 'getTransactionAdherentPrestataireForm']),
            new \Twig_SimpleFunction('getTransactionPrestataireAdherentForm', [$this, 'getTransactionPrestataireAdherentForm']),
            new \Twig_SimpleFunction('getTransactionPrestatairePrestataireForm', [$this, 'getTransactionPrestatairePrestataireForm']),
            new \Twig_SimpleFunction('getReconversionForm', [$this, 'getReconversionForm']),
            new \Twig_SimpleFunction('getChangeAdherentComptoirForm', [$this, 'getChangeAdherentComptoirForm']),
            new \Twig_SimpleFunction('getChangePrestataireComptoirForm', [$this, 'getChangePrestataireComptoirForm']),
            new \Twig_SimpleFunction('getRetraitComptoirToXForm', [$this, 'getRetraitComptoirToXForm']),
            new \Twig_SimpleFunction('getVenteComptoirToXForm', [$this, 'getVenteComptoirToXForm']),
            new \Twig_SimpleFunction('getTransfertComptoirGroupeForm', [$this, 'getTransfertComptoirGroupeForm']),
            new \Twig_SimpleFunction('getTransfertGroupeComptoirForm', [$this, 'getTransfertGroupeComptoirForm']),
            new \Twig_SimpleFunction('getTransfertSiegeGroupeForm', [$this, 'getTransfertSiegeGroupeForm']),
            new \Twig_SimpleFunction('getTransfertGroupeSiegeForm', [$this, 'getTransfertGroupeSiegeForm']),
            new \Twig_SimpleFunction('getSoldeSiegeForm', [$this, 'getSoldeSiegeForm']),
            new \Twig_SimpleFunction('getAchatMonnaieAdherentForm', [$this, 'getAchatMonnaieAdherentForm']),
            new \Twig_SimpleFunction('getAchatMonnaiePrestataireForm', [$this, 'getAchatMonnaiePrestataireForm']),
            new \Twig_SimpleFunction('getVenteEmlcAdherentForm', [$this, 'getVenteEmlcAdherentForm']),
            new \Twig_SimpleFunction('getVenteEmlcPrestataireForm', [$this, 'getVenteEmlcPrestataireForm']),
            new \Twig_SimpleFunction('getAchatMonnaieAConfirmerPrestataireForm', [$this, 'getAchatMonnaieAConfirmerPrestataireForm']),
            new \Twig_SimpleFunction('getAchatMonnaieAConfirmerAdherentForm', [$this, 'getAchatMonnaieAConfirmerAdherentForm']),
            new \Twig_SimpleFunction('getAchatMonnaieAConfirmerPrestataireForm', [$this, 'getAchatMonnaieAConfirmerPrestataireForm']),
            new \Twig_SimpleFunction('getTicketFixPrintForm', [$this, 'getTicketFixPrintForm']),
            new \Twig_SimpleFunction('getTicketFixDestroyForm', [$this, 'getTicketFixDestroyForm']),
        ];
    }

    public function getPrestataireInfosForm(User $user)
    {
        return $this->container->get('app.formfactory')->getPrestataireInfosForm($user);
    }

    public function getAdherentInfosForm(User $user)
    {
        return $this->container->get('app.formfactory')->getAdherentInfosForm($user);
    }

    public function getUserInfosForm(User $user)
    {
        return $this->container->get('app.formfactory')->getUserInfosForm($user);
    }

    public function getUserPasswordForm(User $user)
    {
        return $this->container->get('app.formfactory')->getUserPasswordForm($user);
    }

    public function getGroupeInfosForm(User $user)
    {
        return $this->container->get('app.formfactory')->getGroupeInfosForm($user);
    }

    public function getComptoirInfosForm(User $user)
    {
        return $this->container->get('app.formfactory')->getComptoirInfosForm($user);
    }

    public function getGroupePrestataireInscriptionForm(User $user)
    {
        return $this->container->get('app.formfactory')->getGroupePrestataireInscriptionForm($user);
    }

    public function getTransactionAdherentAdherentForm(User $user)
    {
        return $this->container->get('app.formfactory')->getTransactionAdherentAdherentForm($user);
    }

    public function getTransactionAdherentPrestataireForm(User $user)
    {
        return $this->container->get('app.formfactory')->getTransactionAdherentPrestataireForm($user);
    }

    public function getTransactionPrestataireAdherentForm(User $user)
    {
        return $this->container->get('app.formfactory')->getTransactionPrestataireAdherentForm($user);
    }

    public function getTransactionPrestatairePrestataireForm(User $user)
    {
        return $this->container->get('app.formfactory')->getTransactionPrestatairePrestataireForm($user);
    }

    public function getReconversionForm(User $user)
    {
        return $this->container->get('app.formfactory')->getReconversionForm($user);
    }

    public function getChangeAdherentComptoirForm(User $user)
    {
        return $this->container->get('app.formfactory')->getChangeAdherentComptoirForm($user);
    }

    public function getChangePrestataireComptoirForm(User $user)
    {
        return $this->container->get('app.formfactory')->getChangePrestataireComptoirForm($user);
    }

    public function getRetraitComptoirToXForm(User $user, $destinataire)
    {
        return $this->container->get('app.formfactory')->getRetraitComptoirToXForm($user, $destinataire);
    }

    public function getVenteComptoirToXForm(User $user, $destinataire)
    {
        return $this->container->get('app.formfactory')->getVenteComptoirToXForm($user, $destinataire);
    }

    public function getTransfertComptoirGroupeForm(User $user)
    {
        return $this->container->get('app.formfactory')->getTransfertComptoirGroupeForm($user);
    }

    public function getTransfertGroupeComptoirForm(User $user)
    {
        return $this->container->get('app.formfactory')->getTransfertGroupeComptoirForm($user);
    }

    public function getTransfertSiegeGroupeForm(User $user)
    {
        return $this->container->get('app.formfactory')->getTransfertSiegeGroupeForm($user);
    }

    public function getTransfertGroupeSiegeForm(User $user)
    {
        return $this->container->get('app.formfactory')->getTransfertGroupeSiegeForm($user);
    }

    public function getSoldeSiegeForm(User $user)
    {
        return $this->container->get('app.formfactory')->getSoldeSiegeForm($user);
    }

    public function getAchatMonnaieAdherentForm(User $user)
    {
        return $this->container->get('app.formfactory')->getAchatMonnaieAdherentForm($user);
    }

    public function getAchatMonnaiePrestataireForm(User $user)
    {
        return $this->container->get('app.formfactory')->getAchatMonnaiePrestataireForm($user);
    }

    public function getVenteEmlcAdherentForm(User $user)
    {
        return $this->container->get('app.formfactory')->getVenteEmlcAdherentForm($user);
    }

    public function getVenteEmlcPrestataireForm(User $user)
    {
        return $this->container->get('app.formfactory')->getVenteEmlcPrestataireForm($user);
    }

    public function getAchatMonnaieAConfirmerAdherentForm(User $user)
    {
        return $this->container->get('app.formfactory')->getAchatMonnaieAConfirmerAdherentForm($user);
    }

    public function getAchatMonnaieAConfirmerPrestataireForm(User $user)
    {
        return $this->container->get('app.formfactory')->getAchatMonnaieAConfirmerPrestataireForm($user);
    }

    public function getTicketFixPrintForm(User $user)
    {
        return $this->container->get('app.formfactory')->getTicketFixPrintForm($user);
    }

    public function getTicketFixDestroyForm(User $user)
    {
        return $this->container->get('app.formfactory')->getTicketFixDestroyForm($user);
    }
}