Bonjour,
J'ai l'erreur suivante :
Seulement "AbsencesJustif" est une entité, je ne comprends pas pourquoi il va le chercher dans "FORM".Class App\Form\AbsencesJustif does not exist
Mon JustifAbscence à l'origine de l'erreur ligne 38(dans src/Form)
mon entité (src/Entity/AbscencesJustif)
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 <?php namespace App\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\PasswordType; use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\Extension\Core\Type\TextareaType; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use App\Entity\Pointage; use App\Entity\Cours; use App\Entity\PlageHoraire; use App\Entity\AbscencesJustif; class JustifAbscence extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $formation = $options['formation']; // $formation = $this->getDoctrine()->getRepository(Formation::class)->find($idFormation); $builder ->add('cours', EntityType::class, array( 'class' => Cours::class, 'label' => false, 'placeholder' => 'Cours', 'required' => true, 'choice_label' => 'nomUe', 'choices' => $formation->getCours(), 'attr' => array('class' => 'custom-select') )) ->add('plageHoraireJustif', EntityType::class, array( 'class' => AbsencesJustif::class, 'label' => false, 'placeholder' => 'Plage horaire', 'required' => true, 'choice_label' => 'plageHoraireJustifAbscence', 'attr' => array('class' => 'custom-select') )) /* ->add('plageHoraire', EntityType::class, array( 'class' => "", 'label' => false, 'placeholder' => 'add file', 'required' => true, 'required' => 'input', 'choice_label' => 'addFile', 'attr' => array('class' => 'custom-select') ))*/ ->add('connection', SubmitType::class, array('label' => 'Justifier l\'absence', 'attr' => array('class' => 'btn btn-primary text-uppercase ml-2 px-5'))); } public function configureOptions(OptionsResolver $resolver) { $resolver ->setDefaults([ 'data_class' => Pointage::class, ]) ->setRequired(['formation']); } }
Merci d'avance
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 <?php namespace App\Entity; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity(repositoryClass="App\Repository\PointageRepository") */ class AbscencesJustif { /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $id; /** * @ORM\ManyToOne(targetEntity="App\Entity\Cours", inversedBy="pointage") * @ORM\JoinColumn(nullable=false) */ private $cours; /** * @ORM\ManyToOne(targetEntity="App\Entity\PlageHoraire", inversedBy="pointage") * @ORM\JoinColumn(nullable=false) */ private $plageHoraireJustifAbscence; /** * @ORM\ManyToOne(targetEntity="App\Entity\Utilisateur", inversedBy="pointage") */ private $utilisateurEtudiant; /** * @ORM\ManyToOne(targetEntity="App\Entity\Formation", inversedBy="pointages") * @ORM\JoinColumn(nullable=false) */ private $formation; /** * @ORM\Column(type="boolean") */ private $lien_fichier; public function __construct() { } public function getId(): ?int { return $this->id; } public function getDateJustif(): ?\DateTimeInterface { return $this->dateJustif; } public function setDateJustif(\DateTimeInterface $dateJustif): self { $this->dateJustif = $dateJustif; return $this; } public function getCours(): ?Cours { return $this->cours; } public function setCours(?Cours $cours): self { $this->cours = $cours; return $this; } public function getUtilisateurEtudiant(): ?Utilisateur { return $this->utilisateurEtudiant; } public function setUtilisateurEtudiant(?Utilisateur $utilisateurEtudiant): self { $this->utilisateurEtudiant = $utilisateurEtudiant; return $this; } public function getPlageHoraireJustifAbscence(): ?PlageHoraire { return $this->plageHoraireJustifAbscence; } public function setPlageHoraireJustifAbscence(?PlageHoraire $plageHoraireJustifAbscence): self { $this->plageHoraireJustifAbscence = $plageHoraireJustifAbscence; return $this; } public function getFichierJustification(): ?bool { return $this->lien_fichier; } public function setFichierJustification(bool $lien_fichier): self { $this->lien_fichier = $lien_fichier; return $this; } public function getFormation(): ?Formation { return $this->formation; } public function setFormation(?Formation $formation): self { $this->formation = $formation; return $this; } }
Partager