Bonjour,
Je suis entrain de développer un projet en Symfony2 utilisant l'ORM Doctrine2. Je rencontre des problèmes au niveau du mapping, notamment l'héritage.
Lorsque je lance la commandeElle retourne OK et je peux travailler avec les objets, l'héritage se fait correctement.
Code : Sélectionner tout - Visualiser dans une fenêtre à part app/console doctrine:mapping:info
Alors que quand je lance la commandelà j'ai l'erreur suivante :
Code : Sélectionner tout - Visualiser dans une fenêtre à part app/console doctrine:schema:update --force
Mes classes sont les suivantes :
Code : Sélectionner tout - Visualiser dans une fenêtre à part Warning: class_parents(): Class DOS\EntrepriseBundle\Entity\Candidat does not exist and could not be loaded in /home/sfprojects/sebinize/vendor/doctrine/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php line 223
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 namespace DOS\CandidatBundle\Entity; use Doctrine\ORM\Mapping as ORM; /** * DOS\CandidatBundle\Entity\Personne * * @ORM\Table() * @ORM\Entity * @ORM\InheritanceType("SINGLE_TABLE") * @ORM\DiscriminatorColumn(name="type", type="string") * @ORM\DiscriminatorMap({"candidat" = "DOS\CandidatBundle\Entity\Candidat", "profil" = "DOS\EntrepriseBundle\Entity\Profil"}) * */ class Personne { /** * @var integer $id * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var string $nom * * @ORM\Column(name="nom", type="string", length=30) */ private $nom; /** * @var string $prenom * * @ORM\Column(name="prenom", type="string", length=30) */ private $prenom; /** * @var string $telephone * * @ORM\Column(name="telephone", type="string", length=10) */ private $telephone; /** * @var string $email * * @ORM\Column(name="email", type="string", length=60) */ private $email; /** * @var string $commentaire * * @ORM\Column(name="commentaire", type="string", length=255) */ private $commentaire; /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set nom * * @param string $nom */ public function setNom($nom) { $this->nom = $nom; } /** * Get nom * * @return string */ public function getNom() { return $this->nom; } /** * Set prenom * * @param string $prenom */ public function setPrenom($prenom) { $this->prenom = $prenom; } /** * Get prenom * * @return string */ public function getPrenom() { return $this->prenom; } /** * Set telephone * * @param string $telephone */ public function setTelephone($telephone) { $this->telephone = $telephone; } /** * Get telephone * * @return string */ public function getTelephone() { return $this->telephone; } /** * Set email * * @param string $email */ public function setEmail($email) { $this->email = $email; } /** * Get email * * @return string */ public function getEmail() { return $this->email; } /** * Set commentaire * * @param string $commentaire */ public function setCommentaire($commentaire) { $this->commentaire = $commentaire; } /** * Get commentaire * * @return string */ public function getCommentaire() { return $this->commentaire; } }
Si quelqu'un connaît une solution, je suis preneur avant que je ne repasse sur Propel =)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 namespace DOS\CandidatBundle\Entity; use Doctrine\ORM\Mapping as ORM; use DOS\CandidatBundle\Entity\Personne; use DOS\EntrepriseBundle\Entity\Entreprise; use Doctrine\Common\Annotations\Annotation; /** * DOS\CandidatBundle\Entity\Candidat * * @ORM\Table() * @ORM\Entity */ class Candidat extends Personne { /** * @var string $cv * * @ORM\Column(name="cv", type="string", length=255) */ private $cv; /** * @var string $specialite * * @ORM\Column(name="specialite", type="string", length=30) */ private $specialite; /** * @var string $cursus * * @ORM\Column(name="cursus", type="string", length=20) */ private $cursus; /** * @var string $etat * * @ORM\Column(name="etat", type="string", length=20) */ private $etat; /** * @ORM\OneToOne(targetEntity="DOS\EntrepriseBundle\Entity\Entreprise") * @ORM\JoinColumn(name="entreprise_id", referencedColumnName="id") */ private $entreprise; /** * @ORM\ManyToMany(targetEntity="Promotion") * @ORM\JoinTable(name="candidat_promotion",joinColumns={@ORM\JoinColumn(name="promotion_id", referencedColumnName="id")}, * inverseJoinColumns={@ORM\JoinColumn(name="candidat_id", referencedColumnName="id")} * ) */ private $promotions; public function __construct() { $this->promotions = new \Doctrine\Common\Collections\ArrayCollection(); } /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set cv * * @param string $cv */ public function setCv($cv) { $this->cv = $cv; } /** * Get cv * * @return string */ public function getCv() { return $this->cv; } /** * Set specialite * * @param string $specialite */ public function setSpecialite($specialite) { $this->specialite = $specialite; } /** * Get specialite * * @return string */ public function getSpecialite() { return $this->specialite; } /** * Set cursus * * @param string $cursus */ public function setCursus($cursus) { $this->cursus = $cursus; } /** * Get cursus * * @return string */ public function getCursus() { return $this->cursus; } /** * Set etat * * @param string $etat */ public function setEtat($etat) { $this->etat = $etat; } /** * Get etat * * @return string */ public function getEtat() { return $this->etat; } /** * Set entreprise * * @param Entreprise $entreprise */ public function setEntreprise($entreprise){ $this->entreprise = $entreprise; } /** * Get entreprise * * @return Entreprise */ public function getEntreprise(){ return $this->entreprise; } }
Merci !
Partager