Quantcast
Channel: Grafikart | Derniers Sujets du forum
Viewing all articles
Browse latest Browse all 1542

[symfony 5]Neither the property ...existe

$
0
0

Bonjour,

Voila je rencontre un petit problème avec mon code.

ceci le code d'erreur :
Neither the property "callcenterId" nor one of the methods "callcenterId()", "getcallcenterId()"/"iscallcenterId()"/"hascallcenterId()" or "__call()" exist and have public access in class "Symfony\Component\Form\FormView".

mon controlleur :

around<?phparound aroundnamespace App\Controller;around arounduse Symfony\Bundle\FrameworkBundle\Controller\AbstractController;arounduse Symfony\Component\Routing\Annotation\Route;arounduse Symfony\Component\HttpFoundation\Request;arounduse Symfony\Component\HttpFoundation\Response;arounduse App\Entity\VicidialUserGroups;arounduse App\Entity\CallCenterGroups;arounduse App\Entity\CallCenter;arounduse App\Form\VicidialUserGroupsType;arounduse App\Form\CallCenterGroupsType;around around aroundclass GroupeController extends AbstractControlleraround{around public function nouveauAction(Request $request): Responsearound {around $session = $request->getSession();around if ($session->get('niveau') !== 4){around throw $this->createAccessDeniedException();around } around $groupe = new VicidialUserGroups();around $cappelgrp = new CallCenterGroups();around around around around around $form = $this->createForm(VicidialUserGroupsType::class, $groupe);around $form_assignment = $this->createForm(CallCenterGroupsType::class, $cappelgrp);around around $em = $this->getDoctrine()->getManager();around $form->handleRequest($request);around $form_assignment->handleRequest($request);around around around if ($form->isSubmitted() && $form->isValid() || $form_assignment->isSubmitted() && $form_assignment->isValid){around $centreappel = $em->getRepository(CallCenter::class)->find($form->get('callcenterId')->getData()); around $cappelgrp->setUserGroup($centreappel->getTriptyque() . '_' . $form->get('userGroup')->getData());around $groupe->setUserGroup($centreappel->getTriptyque() . '_' . $groupe->getUserGroup());around $groupe->setGroupName($centreappel->getTriptyque() . '_' . $groupe->getGroupName());around $em->persist($groupe);around $em->persist($cappelgrp);around $em->flush();around around around around }around around around return $this->render('groupe/nouveau_groupe.html.twig', array('form' => $form->createView() , 'form_assignment' =>$form->createView() ));around }around}

Mon entitéCallCenterGroups:
around<?phparound aroundnamespace App\Entity;around arounduse App\Repository\CallCenterGroupsRepository;arounduse Doctrine\ORM\Mapping as ORM;around around/**around * CallCenterCampaignsaround *around * @ORM\Entity(repositoryClass=CallCenterGroupsRepository::class)around * @ORM\Table(name="call_center_groups")around */aroundclass CallCenterGroupsaround{around /**around * @ORM\Idaround * @ORM\GeneratedValue(strategy="IDENTITY")around * @ORM\Column(type="integer")around */around private $id;around around /**around * @ORM\Column(name="user_group", type="string", length=20, nullable=false)around */around private $userGroup;around around /**around * @ORM\Column(name="callcenter_id", type="integer", nullable=false)around */around private $callcenterId;around around public function getId(): ?intaround {around return $this->id;around }around around public function getUserGroup(): ?stringaround {around return $this->userGroup;around }around around public function setUserGroup(string $userGroup): selfaround {around $this->userGroup = $userGroup;around around return $this;around }around/**around * Set callcenterIdaround *around * @param integer callcenterIdaround * @return CallCenterGroupsaround */around public function setCallcenterId($callcenterId) {around $this->callcenterId = $callcenterId;around around return $this;around }around around /**around * Get callcenterIdaround *around * @return integeraround */around public function getCallcenterId() {around return $this->callcenterId;around }around around}

mon entité callcenter:
<?phparound aroundnamespace App\Entity;around arounduse App\Repository\CallCenterRepository;arounduse Doctrine\ORM\Mapping as ORM;around around/**around * @ORM\Entity(repositoryClass=CallCenterRepository::class)around */aroundclass CallCenteraround{around /**around * @ORM\Idaround * @ORM\GeneratedValuearound * @ORM\Column(type="integer")around */around private $id;around around /**around * @ORM\Column(type="string", length=255)around */around private $name;around around /**around * @ORM\Column(type="string", length=10)around */around private $triptyque;around around public function getId(): ?intaround {around return $this->id;around }around around public function getName(): ?stringaround {around return $this->name;around }around around public function setName(string $name): selfaround {around $this->name = $name;around around return $this;around }around around public function getTriptyque(): ?stringaround {around return $this->triptyque;around }around around public function setTriptyque(string $triptyque): selfaround {around $this->triptyque = $triptyque;around around return $this;around }around}around

mon formulaire :

aroundnamespace App\Form;arounduse App\Entity\CallCenter;arounduse App\Entity\CallCenterGroups;arounduse Symfony\Component\Form\AbstractType;arounduse Symfony\Component\Form\FormBuilderInterface;arounduse Symfony\Component\OptionsResolver\OptionsResolver;arounduse Symfony\Bridge\Doctrine\Form\Type\EntityType;around around aroundclass CallCenterGroupsType extends AbstractTypearound{around public function buildForm(FormBuilderInterface $builder, array $options)around {around $builderaround around ->add('callcenterId', EntityType::class, array('label' => 'Centre d\'appel', 'class' => CallCenter::class, 'choice_label' => 'name',around 'empty_data' => 'Choisissez un centre appel',around 'multiple' => true,around 'expanded' => true,around 'required' => false,around around 'attr' => array('class' => 'form-control')))around ;around }around around public function configureOptions(OptionsResolver $resolver)around {around $resolver->setDefaults([around 'data_class' => CallCenterGroups::class,around ]);around }around

mon twig :

{% extends 'superadmin.html.twig'%}around around around {% block body %}around around around around <div class="container-fluid">around around <!-- Page Heading -->around <h1 class="h3 mb-4 text-gray-800">Nouveau groupe</h1>around around </div>around around around around around around <div>around <!-- form start -->around {{ form_start(form)}}around <div>around <div class="row">around <div class="col-md-6">around around <div class="form-group">around <label>{{ form_label(form_assignment.callcenterId) }}</label>around {{ form_widget(form_assignment.callcenterId) }}around <span class="text-danger">{{ form_errors(form_assignment.callcenterId) }}</span>around </div>around around around <div class="form-group">around <label>{{ form_label(form.userGroup) }}</label>around {{ form_widget(form.userGroup) }}around <span class="text-danger">{{ form_errors(form.userGroup) }}</span>around <div id="notification"></div>around </div>around </div>around <div class="col-md-6">around <div class="form-group">around <label>{{ form_label(form.allowedCampaigns) }}</label>around {{ form_widget(form.allowedCampaigns) }}around <span class="text-danger">{{ form_errors(form.allowedCampaigns) }}</span>around </div>around <div class="form-group">around <label>{{ form_label(form.groupName) }}</label>around {{ form_widget(form.groupName) }}around <span class="text-danger">{{ form_errors(form.groupName) }}</span>around </div>around </div>around </div>around </div>around around <div>around <button type="submit" class="btn btn-primary">Ajouter</button>around around <a class="btn btn-warning" href="">Retour</a>around </div>around {{ form_end(form)}}around </div>around </div>around </div>around{% endblock %}around

comment je peux résoudre cette érreur
merci d'avance


Viewing all articles
Browse latest Browse all 1542

Trending Articles