Symfony 3: показывает 2 столбца одного и того же объекта в choiceLabel и выбирает только один - PullRequest
0 голосов
/ 21 сентября 2018

Я действительно не знаю, как четко объяснить в названии, я надеюсь, что это будет достаточно ясно.Я не нашел то, что мне нужно в моих исследованиях, поэтому спасибо за ваше время.

Прямо сейчас у меня есть: "Affaire" Entity У него есть ID (PrimaryKey), описание (называемое libelle), функцияс именем getNoAffaireTxt (который вычисляет уникальный идентификатор, такой как 2.3.666, с указанием года, человека, который создает дело и т. д.) и других вещей.

Когда я создаю новый марш в форме, мне нужно иметь возможностьсвязать «дело» с «маршем», поэтому я сделал это:

Affaire.php

    /**
     * @var integer
     *
     * @ORM\Column(name="id_affai", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="SEQUENCE")
     * @ORM\SequenceGenerator(sequenceName="id_affai_seq", initialValue=1, allocationSize=1)
     */ 
    private $idAffai;

      /**
      * @var \SIG\CoreBundle\Entity\Agence
      *
      * @ORM\ManyToOne(targetEntity="SIG\CoreBundle\Entity\Agence")
      * @ORM\JoinColumn(name="id_agen",referencedColumnName="id_agen",nullable=false)
      */ 
    private $Agence;

    /**
     * @var integer
     * @ORM\Column(name="annee",type="integer",nullable=false)
     */
    private $annee;

    /**
     * @var \SIG\VteBundle\Entity\ClientAffaire
     *
     * @ORM\ManyToOne(targetEntity="SIG\VteBundle\Entity\ClientAffaire",inversedBy="affaires"))
     * @ORM\JoinColumn(name="id_cliaff",referencedColumnName="id_cliaff",nullable=false)
     */ 
    private $ClientAffaire;

    /**
     * @var integer
     * @ORM\Column(name="no_ordre",type="integer",nullable=false)
     */
    private $noOrdre;


    /**
     * @var string
     * @ORM\Column(name="libelle",type="string",length=100,nullable=false)
     * @Assert\Length(
     * max = 100,
     * maxMessage = "Le Nom du ClientAffaire ne peut excéder {{LIMIT}} caratères."
    *)
     */
    private $libelle;

    /**
     * @var \SIG\VteBundle\Entity\Affaire
     * @ORM\ManyToOne(targetEntity="SIG\VteBundle\Entity\Affaire")
     * @ORM\JoinColumn(name="id_affai_mere",referencedColumnName="id_affai",nullable=true)
     */
    private $AffaireMere;


    /**
     * @var integer
     * @ORM\Column(name="etat",type="smallint",nullable=true)
     */
     private $etat;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="created", type="datetime",  nullable=true)
     */
    private $created;

    /**
     * @var integer
     *
     * @ORM\ManyToOne(targetEntity="SIG\UserBundle\Entity\Utilisateur")
     * @ORM\JoinColumn(name="createdby",referencedColumnName="id_util")
     */
    private $createdby;


    /**
     * @var string
     * @ORM\Column(name="description",type="text",nullable=true)
     */
     private $description;

    /**
     * @var boolean
     * @ORM\Column(name="hors_groupement",type="boolean",nullable=true)
     */
     private $horsGroupement = true; // A conserver ?

    /**
     * @var string
     * @ORM\Column(name="repertoire",type="text",nullable=true)
     */
     private $repertoire;

    /**
     * @var \SIG\AchatBundle\Entity\CdePrestataire
     * @ORM\OneToMany(targetEntity="SIG\AchatBundle\Entity\CdePrestataire",mappedBy="Affaire",cascade={"persist","remove"},orphanRemoval=true)
     */
    private $commandesPrestataire;

    /**
     * @ORM\OneToMany(targetEntity="SIG\VteBundle\Entity\Plans",mappedBy="idAffaire",cascade={"persist","remove"},orphanRemoval=true)
     */
    private $plans;

    /**
     * Constructor
     */
    public function __construct(\SIG\UserBundle\Entity\Utilisateur $Utilisateur=null)
    {
        $this->utilisateursAutorises = new ArrayCollection();
        $this->cdeprestatairecomments = new ArrayCollection();
        $this->created=new \DateTime();
        $this->annee=date('y');
        if (null!==$Utilisateur) {
            $this->createdBy=$Utilisateur;
            $this->Agence=$Utilisateur->getAgence();
        }
        $this->Etat=20; /* en cours */
    }



    /////////////////  Specifiques //////////////////////
    /* Gets spécifiques pour listes déroulantes, et Ajax */
    /*  Donnees formatées */

    /**
     * @var string
   * getNoAffaireTxt
   * Retourne le numero ordre pour sélection
   */
    public function getNoAffaireTxtOld()
    {
        return sprintf('%1$02d%2$02d%3$03d%4$02d',$this->Agence->getIdAgen(),$this->annee,$this->ClientAffaire->getIdCliAff(),$this->noOrdre);
    }

    public function getNoAffaireTxt($sep='.')
    {
        return sprintf('%1$02d',$this->Agence->getIdAgen()).$sep.sprintf('%1$02d',$this->annee).$sep.sprintf('%1$03d',$this->ClientAffaire->getIdCliAff()).$sep.sprintf('%1$02d',$this->noOrdre);
    }


     public function getNoAffaireTxtLib()
    {
        return sprintf('%1$02d %2$02d %3$03d %4$02d %5$s',$this->Agence->getIdAgen(),$this->annee,$this->ClientAffaire->getIdCliAff(),$this->noOrdre
        ,$this->libelle);
    }
    public function getClientAffaireLibelle(){
        // Ici On retourne le ClientAffaire Affaire
        //return '['.$this->ClientAffaire->getRaisonSociale().'] '.$this->libelle;
        return '['.$this->ClientAffaire->getLibelle().'] '.$this->libelle;
    }

    public function getSelectionAffaire(){
        // Special pour les listes de Selection des Form (choice_label)
        //
        return $this->getLibelleAffaire();// Pour l'instant on retourne l'indicateur dessous mais on se laisse la possibilité d'évoluer
    }

    public function getLibelleAffaire($sep='') {
        return $this->getNoAffaireTxt().' '.$this->getClientAffaireLibelle();
    }


    /* Creation d'un tableau au format lisibe pour Ajax... */
    public function getJsonAffaire()
    {
        $retour= array(
            'idAffai'=> $this->idAffai,
            'libelle'=> $this->libelle,
            'idAgen'=>  $this->Agence->getIdAgen(),
            'annee'=> $this->annee,
            'idCliAff'=>$this->ClientAffaire->getIdCliAff(),
            'NoOrdre'=>$this->noOrdre,
            'etat'=>$this->etat
            );
    /*  if(!$this->Utilisateur==null) {
            $retour['idUtilResp']=$this->Utilisateur->getIdUtil();
        }*/
        return $retour;
    }   

        /////////////////  End of Specifiques //////////////////////


    /**
     * Get idAffai
     *
     * @return integer
     */
    public function getIdAffai()
    {
        return $this->idAffai;
    }

   /**
     * Get noOrdreTxt
     *
     * @return string 00
     */
    public function getNoOrdreTxt()
    {
        return sprintf('%1$02d',$this->noOrdre);
    }


    /**
     * Set annee
     *
     * @param integer $annee
     *
     * @return Affaire
     */
    public function setAnnee($annee)
    {
        $this->annee = $annee;

        return $this;
    }

    /**
     * Get annee
     *
     * @return integer
     */
    public function getAnnee()
    {
        return $this->annee;
    }


    /**
     * Set noOrdre
     *
     * @param integer $noOrdre
     *
     * @return Affaire
     */
    public function setNoOrdre($noOrdre)
    {
        $this->noOrdre = $noOrdre;

        return $this;
    }

    /**
     * Get noOrdre
     *
     * @return integer
     */
    public function getNoOrdre()
    {
        return $this->noOrdre;
    }


    /**
     * Set libelle
     *
     * @param string $libelle
     *
     * @return Affaire
     */
    public function setLibelle($libelle)
    {
        $this->libelle = $libelle;

        return $this;
    }

    /**
     * Get libelle
     *
     * @return string
     */
    public function getLibelle()
    {
        return $this->libelle;
    }

    /**
     * Set description
     *
     * @param string $description
     *
     * @return Affaire
     */
    public function setDescription($description)
    {
        $this->description = $description;

        return $this;
    }

    /**
     * Get description
     *
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }


    /**
     * Set etat
     *
     * @param integer $etat
     *
     * @return Affaire
     */
    public function setEtat($etat)
    {
        $this->etat = $etat;

        return $this;
    }

    /**
     * Get etat
     *
     * @return integer
     */
    public function getEtat()
    {
        return $this->etat;
    }

    /**
     * Set agence
     *
     * @param \SIG\CoreBundle\Entity\Agence $agence
     *
     * @return Affaire
     */
    public function setAgence(\SIG\CoreBundle\Entity\Agence $agence)
    {
        $this->Agence = $agence;

        return $this;
    }

    /**
     * Get agence
     *
     * @return \SIG\CoreBundle\Entity\Agence
     */
    public function getAgence()
    {
        return $this->Agence;
    }


    /**
     * Set client
     *
     * @param \SIG\VteBundle\Entity\ClientAffaire $client
     *
     * @return Affaire
     */
    public function setClientAffaire(\SIG\VteBundle\Entity\ClientAffaire $client)
    {
        $this->ClientAffaire = $client;

        return $this;
    }

    /**
     * Get client
     *
     * @return \SIG\VteBundle\Entity\ClientAffaire
     */
    public function getClientAffaire()
    {
        return $this->ClientAffaire;
    }

    /**
     * Set affaireMere
     *
     * @param \SIG\VteBundle\Entity\Affaire $affaireMere
     *
     * @return Affaire
     */
    public function setAffaireMere(\SIG\VteBundle\Entity\Affaire $affaireMere = null)
    {
        $this->AffaireMere = $affaireMere;

        return $this;
    }

    /**
     * Get affaireMere
     *
     * @return \SIG\VteBundle\Entity\Affaire
     */
    public function getAffaireMere()
    {
        return $this->AffaireMere;
    }

    /**
     * Set site
     *
     * @param \SIG\CoreBundle\Entity\Site $site
     *
     * @return Affaire
     */
    public function setSite(\SIG\CoreBundle\Entity\Site $site = null)
    {
        $this->Site = $site;

        return $this;
    }

    /**
     * Get site
     *
     * @return \SIG\CoreBundle\Entity\Site
     */
    public function getSite()
    {
        return $this->Site;
    }



    /**
     * Add utilisateursAutorise
     *
     * @param \SIG\UserBundle\Entity\UtilisateurAffaire $utilisateursAutorise
     *
     * @return Affaire
     */
    public function addUtilisateursAutorise(\SIG\UserBundle\Entity\UtilisateurAffaire $utilisateursAutorise)
    {
        $this->utilisateursAutorises[] = $utilisateursAutorise;
        $utilisateursAutorise->setAffaire($this);

        return $this;
    }

    /**
     * Remove utilisateursAutorise
     *
     * @param \SIG\UserBundle\Entity\UtilisateurAffaire $utilisateursAutorise
     */
    public function removeUtilisateursAutorise(\SIG\UserBundle\Entity\UtilisateurAffaire $utilisateursAutorise)
    {
        $this->utilisateursAutorises->removeElement($utilisateursAutorise);
    }

    /**
     * Get utilisateursAutorises
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getUtilisateursAutorises()
    {
        return $this->utilisateursAutorises;
    }

    /**
     * Set created
     *
     * @param \DateTime $created
     *
     * @return Affaire
     */
    public function setCreated($created)
    {
        $this->created = $created;

        return $this;
    }

    /**
     * Get created
     *
     * @return \DateTime
     */
    public function getCreated()
    {
        return $this->created;
    }


    /**
     * Set createdby
     *
     * @param \SIG\UserBundle\Entity\Utilisateur $createdby
     *
     * @return Affaire
     */
    public function setCreatedby(\SIG\UserBundle\Entity\Utilisateur $createdby = null)
    {
        $this->createdby = $createdby;

        return $this;
    }

    /**
     * Get createdby
     *
     * @return \SIG\UserBundle\Entity\Utilisateur
     */
    public function getCreatedby()
    {
        return $this->createdby;
    }

    /**
     * Set horsGroupement
     *
     * @param boolean $horsGroupement
     *
     * @return Affaire
     */
    public function setHorsGroupement($horsGroupement)
    {
        $this->horsGroupement = $horsGroupement;

        return $this;
    }

    /**
     * Get horsGroupement
     *
     * @return boolean
     */
    public function getHorsGroupement()
    {
        return $this->horsGroupement;
    }

    /**
     * Set chargeAffaire
     *
     * @param \SIG\UserBundle\Entity\Utilisateur $chargeAffaire
     *
     * @return Affaire
     */
    public function setChargeAffaire(\SIG\UserBundle\Entity\Utilisateur $chargeAffaire = null)
    {
        $this->chargeAffaire = $chargeAffaire;

        return $this;
    }

    /**
     * Get chargeAffaire
     *
     * @return \SIG\UserBundle\Entity\Utilisateur
     */
    public function getChargeAffaire()
    {
        return $this->chargeAffaire;
    }

    /**
     * Add commandesPrestataire
     *
     * @param \SIG\AchatBundle\Entity\CdePrestataire $commandesPrestataire
     *
     * @return Affaire
     */
    public function addCommandesPrestataire(\SIG\AchatBundle\Entity\CdePrestataire $commandesPrestataire)
    {
        $this->commandesPrestataire[] = $commandesPrestataire;

        return $this;
    }

    /**
     * Remove commandesPrestataire
     *
     * @param \SIG\AchatBundle\Entity\CdePrestataire $commandesPrestataire
     */
    public function removeCommandesPrestataire(\SIG\AchatBundle\Entity\CdePrestataire $commandesPrestataire)
    {
        $this->commandesPrestataire->removeElement($commandesPrestataire);
    }

    /**
     * Get commandesPrestataire
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getCommandesPrestataire()
    {
        return $this->commandesPrestataire;
    }


    /**
     * Set repertoire
     *
     * @param string $repertoire
     *
     * @return Affaire
     */
    public function setRepertoire($repertoire)
    {
        $this->repertoire = $repertoire;

        return $this;
    }

    /**
     * Get repertoire
     *
     * @return string
     */
    public function getRepertoire()
    {
        return $this->repertoire;
    }

    /**
     * Add plan
     *
     * @param \SIG\VteBundle\Entity\Plans $plan
     *
     * @return Affaire
     */
    public function addPlan(\SIG\VteBundle\Entity\Plans $plan)
    {
        $this->plans[] = $plan;

        return $this;
    }

    /**
     * Remove plan
     *
     * @param \SIG\VteBundle\Entity\Plans $plan
     */
    public function removePlan(\SIG\VteBundle\Entity\Plans $plan)
    {
        $this->plans->removeElement($plan);
    }

    /**
     * Get plans
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getPlans()
    {
        return $this->plans;
    }

Marche.php

класс Marche

/**
 * @var integer
 * @ORM\GeneratedValue(strategy="SEQUENCE")
 * @ORM\Id
 * @ORM\Column(name="id_mar", type="integer", unique=true)
 */
private $idMar;

/**
 * @var string|null
 *
 * @ORM\Column(name="Libelle", type="string", length=255, nullable=true)
 */
private $libelle;

/**
 * @var string|null
 *
 * @ORM\Column(name="Description", type="string", length=255, nullable=true)
 */
private $description;

/**
 * @var \DateTime|null
 *
 * @ORM\Column(name="date_marche", type="datetime", length=255, nullable=true)
 */
private $dateMarche;

/**
 * @var integer
 *
 * @ORM\Column(name="etat", type="smallint", nullable=true)
 */
private $etat;

/**
 * @var \DateTime|null
 *
 * @ORM\Column(name="created", type="datetime", nullable=true)
 */
private $created;

/**
 * @var int|null
 *
 * @ORM\Column(name="createdBy", type="integer", nullable=true)
 */
private $createdBy;

/**
 * @var float|null
 *
 * @ORM\Column(name="Montant_Initial", type="float", nullable=true)
 */
private $montantInitial;

/**
 * @var float|null
 *
 * @ORM\Column(name="Mt_InitialSigedi", type="float", nullable=true)
 */
private $mtInitialSigedi;

/**
 * @var bool|null
 *
 * @ORM\Column(name="pilote_par_sigedi", type="boolean", nullable=true)
 */
private $piloteParSigedi;

/**
 * @var bool|null
 *
 * @ORM\Column(name="groupement", type="boolean", nullable=true)
 */
private $groupement;
/**
 * @var \SIG\VteBundle\Entity\Affaire
 * @ORM\OneToOne(targetEntity="SIG\VteBundle\Entity\Affaire")
 * @ORM\JoinColumn(name="id_affaireliee",referencedColumnName="id_affai",nullable=true)
 */
private $affaireLiee;



public function __construct(\SIG\UserBundle\Entity\Utilisateur $Utilisateur=null, $id=null)
{
    $this->created=new \DateTime();
    $this->createdBy=null===$Utilisateur?null:$Utilisateur->getId();
    $this->listemarches = new ArrayCollection();

    if (null!==$id){
        if ($id instanceof \SIG\UserBundle\Entity\Utilisateur){
            $this->createdBy=$id->getId();
        }else{
            $this->createdBy=$id;
        }
        $this->Etat=20;
    }
}

/**
 * Set idMar.
 *
 * @param int $idMar
 *
 * @return Marche
 */
public function setIdMar($idMar)
{
    $this->idMar = $idMar;

    return $this;
}

/**
 * Get idMar.
 *
 * @return int
 */
public function getIdMar()
{
    return $this->idMar;
}

/**
 * Set libelle.
 *
 * @param string|null $libelle
 *
 * @return Marche
 */
public function setLibelle($libelle = null)
{
    $this->libelle = $libelle;

    return $this;
}

/**
 * Get libelle.
 *
 * @return string|null
 */
public function getLibelle()
{
    return $this->libelle;
}

/**
 * Set description.
 *
 * @param string|null $description
 *
 * @return Marche
 */
public function setDescription($description = null)
{
    $this->description = $description;

    return $this;
}

/**
 * Get description.
 *
 * @return string|null
 */
public function getDescription()
{
    return $this->description;
}
/**
 * Set etat.
 *
 * @param integer $etat
 *
 * @return Marche
 */
public function setEtat($etat)
{
    $this->etat = $etat;

    return $this;
}

/**
 * Get etat.
 *
 * @return int
 */
public function getEtat()
{
    return $this->etat;
}

/**
 * Set created.
 *
 * @param \DateTime|null $created
 *
 * @return Marche
 */
public function setCreated($created = null)
{
    $this->created = $created;

    return $this;
}
/**
 * Set createdBy.
 *
 * @param int|null $createdBy
 *
 * @return Marche
 */
public function setCreatedBy($createdBy = null)
{
    $this->createdBy = $createdBy;

    return $this;
}
/**
 * Set montantInitial.
 *
 * @param float|null $montantInitial
 *
 * @return Marche
 */
public function setMontantInitial($montantInitial = null)
{
    $this->montantInitial = $montantInitial;

    return $this;
}

/**
 * Get montantInitial.
 *
 * @return float|null
 */
public function getMontantInitial()
{
    return $this->montantInitial;
}

/**
 * Set mtInitialSigedi.
 *
 * @param float|null $mtInitialSigedi
 *
 * @return Marche
 */
public function setMtInitialSigedi($mtInitialSigedi = null)
{
    $this->mtInitialSigedi = $mtInitialSigedi;

    return $this;
}

/**
 * Get mtInitialSigedi.
 *
 * @return float|null
 */
public function getMtInitialSigedi()
{
    return $this->mtInitialSigedi;
}

/**
 * Set piloteParSigedi.
 *
 * @param bool|null $piloteParSigedi
 *
 * @return Marche
 */
public function setPiloteParSigedi($piloteParSigedi = null)
{
    $this->piloteParSigedi = $piloteParSigedi;

    return $this;
}

/**
 * Get piloteParSigedi.
 *
 * @return bool|null
 */
public function getPiloteParSigedi()
{
    return $this->piloteParSigedi;
}

/**
 * Set groupement.
 *
 * @param bool|null $groupement
 *
 * @return Marche
 */
public function setGroupement($groupement = null)
{
    $this->groupement = $groupement;

    return $this;
}

/**
 * Get groupement.
 *
 * @return bool|null
 */
public function getGroupement()
{
    return $this->groupement;
}

/**
 * Add listemarche
 *
 * @param \SIG\VteBundle\Entity\Marche $listemarche
 *
 * @return Marche
 */
public function addListemarche(\SIG\VteBundle\Entity\Marche $listemarche)
{
    $this->listemarches[] = $listemarche;
    $listemarche->setMarche($this);

    return $this;
}

/**
 * Remove listemarche
 *
 * @param \SIG\VteBundle\Entity\Marche $listemarche
 */
public function removeListemarche(\SIG\VteBundle\Entity\Marche $listemarche)
{
    $this->listemarches->removeElement($listemarche);
}

/**
 * Get listemarches
 *
 * @return \Doctrine\Common\Collections\Collection
 */
public function getListemarches()
{
    return $this->listemarches;
}

/**
 * Set affaireLiee
 *
 * @param \SIG\VteBundle\Entity\Affaire $affaireLiee
 * nullable
 *
 * @return Marche
 */
public function setaffaireLiee(\SIG\VteBundle\Entity\Affaire $affaireLiee = null)
{
    $this->affaireLiee = $affaireLiee;

    return $this;
}

/**
 * Get affaireLiee
 *
 * @return \SIG\VteBundle\Entity\Affaire
 */
public function getaffaireLiee()
{
    return $this->affaireLiee;
}

}

    {#Marche edit.html.twig#}
{# VteBundle/Resources/views/Marche/edit.html.twig #}

{% extends "SIGCoreBundle::layoutCore.html.twig" %}

{% block stylesheets %}
    {{parent()}}
{% endblock %}

{% block title %}
    {{workFlow.action|capitalize}} Marche
{% endblock %}
{% block titre %}
    {{workFlow.action|capitalize}} Marche
{% endblock %}

{% block startForm %}
    {{form_start(form,{'attr':{'class':'dataform'}}) }} {%endblock%}
{% block leftSideMenu %}

    <div class="sideMenu">

        <div id="menuEtat" class="menuColor">
            <h2>{{workFlow.action|capitalize ~' '~ workFlow.tableName|capitalize}}</h2>
            <ul>
                {%if workFlow.action|lower=='consultation' %}
                    {%if is_granted('ROLE_FACTURATION') %}
                        <li>
                            <a href="{{path('vte_marche',{'traitement':'modification','id':Marche.idMar})}}" class="btn btn-warning" data-toggle="tooltip" title="Modification" data-placement="bottom">Modification <i class="{{iconmodif}}"></i></a></li>
                    {%endif%}
                {%else%}
                    {%if workFlow.editMode|default(false) %}
                        <li>{{form_row(form.Enregistrer)}}</li>
                    {%endif%}
                {%endif%}


                <hr>
                <li><a href="{{path('vte_marche',{'traitement':'selection'})}}" id="btnCancel" class="btn btn-danger myBtnCancel" data-toggle="tooltip" title="Adandon des modifications en cours" data-placement="bottom">Sortie</a></li>
            </ul>
        </div>
    </div> <!--  id=sideMenu -->
{% endblock %}

{% block container %}

    <div class="well maFlexBox fullSizeWidth" style="margin-top:2%;">
        <div style="width:48%;">
            {{ form_row(form.libelle) }}
            {{form_row(form.etat)}}

        </div>
        <div class="smallHalfSizeWidth">
            {{form_row(form.date_marche)}}
            {{ form_row(form.description) }}


        </div>
        <div class="smallHalfSizeWidth">
            {{form_row(form.montantInitial)}}
        </div>
        <div class="smallHalfSizeWidth">
            {{form_row(form.mtInitialSigedi)}}

        </div>
        <div class="smallHalfSizeWidth" >
            {{form_widget(form.piloteParSigedi)}}
            {{ form_row(form.affaireLiee) }}

        </div>
        <div class="smallHalfSizeWidth" >
            {{form_widget(form.groupement)}}
        </div>
        </div>
    </div>
{% endblock%} {# body #}

{% block rightSideMenu %}
    <div id="rightSideMenu" class="sideMenu">
        {% include "SIGCoreBundle:Comments:addComments.html.twig" with {"commentaire":commentaire} %}
    </div>
{%endblock%}

{% block endForm %}

    {{ form_errors(form)}}
    <div class="invisible">
        {{form_rest(form)}}
    </div>
    {{form_end(form)}}
{% endblock %}
{% block footer %}
{% endblock footer %} {# footer #}


{% block javascripts %}
    {{parent()}}
    {%if workFlow.editMode %}
        <script type="text/javascript">
            var idProto='#{{form.vars.id}}_imports';
            var btn='<a class="btn btn-success" onclick="newProto('+"'"+'#{{form.vars.id}}_imports'+"'"+')">Nouvelle Equivalence</a>';
            console.log(btn);
            $(idProto).closest('div').append(btn);
            {#index=$(idProto).attr("data-index");
            if (!index) index=0;
            if (index==0) {
            newProto(idProto);
            }#}
        </script>
    {%endif%}
{% endblock %}

Таким образом, на моем ярлыке выбора пользователи могут видеть NoAffaire, связанный с описанием дела, например:

Выберите дело

5.6.123 Изменить экран

9.3.987 Помочь кому-нибудь

Но я не знаю, как получить оба из NoAffaire и Description в affaireLiee в моей таблице Marche (илипо крайней мере, мой NoAffaire).

Что я могу сделать?

Спасибо, ребята, что читаете и, возможно, отвечаете.

...