Précédent   Forum des professionnels en informatique > PHP > Bibliothèques et frameworks > symfony
symfony Forum d'entraide sur le framework PHP symfony. Avant de poster : cours symfony et FAQ symfony
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 18/08/2011, 11h01   #1
Futur Membre du Club
 
Homme
Étudiant
Inscription : novembre 2008
Messages : 67
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Étudiant
Secteur : High Tech - Éditeur de logiciels

Informations forums :
Inscription : novembre 2008
Messages : 67
Points : 16
Points : 16
Par défaut Fixture au comportement étrange

Bonjour à tous !

j'ai un léger soucis au niveau de mes fixtures.

Suite à un data-dump via symfony qui m'a généré un fichier de fixture qu'il n'arrivait pas à reprendre en entrée pour re-créer la base (), j'ai remodifié le fichier pour qu'il le comprenne.

mais j'ai un petit soucis :

Dans une même table, j'ai deux champs qui pointe vers une même table, un id d'un gestionnaire local et un id d'un gestionnaire national qui sont tous deux des "Personne".



Code :
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
#Call for proposal
 
AppelAProjet:
  tableName: Appel_a_projet
  columns:
    nomAppel:
      type: string(255)
      notnull: true
    dateAppel:
      type: date(25)
      notnull: true
    dateFin:
      type: date(25)
      unsigned: true
      notnull: true
    Gestionnaire_nat_id:
      type: integer(8)
      notnull: true
    Gestionnaire_centre_id:
      type: integer(8)
      notnull: true
  relations:
    Personne:
      class: Personne
      local: Gestionnaire_centre_id
      foreignAlias: AppelAProjetsGCenter
    Personne:
      class: Personne
      local: Gestionnaire_nat_id
      foreignAlias: AppelAProjetsGNat
    ContratsLies:
      class: Formelle
      local: contrat_id
      type: many
      foreignAlias: AppelAProjetsFormelle
 
Personne:
  tableName: Personne
  columns:
    nompersonne:
      type: string(255)
      notnull: true
    nom2personne:
      type: string(255)
    prenompersonne:
      type: string(255)
      notnull: true
    prenom2personne:
      type: string(255)
    emailpersonne:
      type: string(255)
    sexepersonne:
      type: string(255)
      notnull: true
    institution_id:
      type: integer(8)
      notnull: trueq
    statut_personne:
      type: string(255)
      notnull: true
  relations:
    Institution:
      foreignAlias: Personnes
    Sexe:
      class: Sexe
      local: sexepersonne
      foreign: sexe
      foreignAlias: Personnes
    Libelle_statut_personne:
      class: Libelle_statut_personne
      local: statut_personne
      foreign: nom_statut
      foreignAlias: Personnes
 
Sexe:
  tableName: Sexe
  columns:
#Oui, un id de table de type String, c'est laid, je le sais....
    sexe:
      type: string(255)
      primary: true
et mes fixtures :
Code :
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
 
AppelAProjet:
  AppelAProjet_1:
    nomAppel: 'Associate Team 11'
    dateAppel: '2011-07-13'
    dateFin: '2011-09-30'
    Personne: Personne_3
    Personne: Personne_6
  AppelAProjet_2:
    nomAppel: 'Associate Team 10'
    dateAppel: '2010-07-15'
    dateFin: '2010-09-30'
    Personne: Personne_5
    Personne: Personne_7
 
Personne:
  Personne_3:
    nompersonne: P******t
    prenompersonne: S*****e
    emailpersonne: p****t@*****.fr
    Sexe: Sexe_F
    Institution: Institution_1
    Libelle_statut_personne: Libelle_statut_personne_Professor
  Personne_6:
    nompersonne: V*****
    prenompersonne: V******e
    emailpersonne: v******e.v******@******.fr
    Sexe: Sexe_F
    Institution: Institution_3
    Libelle_statut_personne: Libelle_statut_personne_Professor
  Personne_7:
    nompersonne: Pl******
    prenompersonne: E******
    emailpersonne: e******.p******@******.fr
    Sexe: Sexe_F
    Institution: Institution_6
    Libelle_statut_personne: Libelle_statut_personne_Professor
Donc au final, il ne me met qu'une des deux "Personne" dans le champ "Gestionnaire national id" et rien dans le champ "gestionnaire Local id"...
Noobboy est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 18/08/2011, 14h56   #2
Membre chevronné
 
Avatar de Herode
 
Développeur Web
Inscription : mars 2005
Messages : 771
Détails du profil
Informations personnelles :
Localisation : France, Savoie (Rhône Alpes)

Informations professionnelles :
Activité : Développeur Web

Informations forums :
Inscription : mars 2005
Messages : 771
Points : 790
Points : 790
Normal : tu as déclaré deux fois la relation Personne avec le même alias. La dernière déclaration gagne, c'est celle du gestionnaire national.
Herode est déconnecté   Envoyer un message privé Réponse avec citation 10
Vieux 18/08/2011, 15h32   #3
Futur Membre du Club
 
Homme
Étudiant
Inscription : novembre 2008
Messages : 67
Détails du profil
Informations personnelles :
Sexe : Homme
Localisation : France

Informations professionnelles :
Activité : Étudiant
Secteur : High Tech - Éditeur de logiciels

Informations forums :
Inscription : novembre 2008
Messages : 67
Points : 16
Points : 16
Ah oui !

Damned, j'avais pourtant fait la chasse à ce genre d'erreur !

merci à toi !
Noobboy est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 16h09.


 
 
 
 
Partenaires

Hébergement Web