title: symfony 5 Can't get a way to read the property "tipoinvitado" in class
body: <p>i need select users and pick a role, but when i add role, i get this fail:</p>
  <p><strong>Can't get a way to read the property &quot;tipoinvitado&quot; in class &quot;App\Entity\Evento&quot;.</strong></p>
  <p>te property &quot;tipoinvitado&quot; have on other entitity</p>
  <p>controller</p>
  <pre><code>  public function a(Request $request, Evento $evento){
          $user_repo = $this-&gt;getDoctrine()-&gt;getRepository(User::class);
          $users = $user_repo-&gt;findAll();    
  
          $evento = $this-&gt;getDoctrine()-&gt;getRepository(Evento::class)-&gt;findOneById($evento); 
          $form = $this-&gt;createForm(AsignarEventoFormType::class, $evento);
          $form-&gt;handleRequest($request);
          
          if($form-&gt;isSubmitted() &amp;&amp; $form-&gt;isValid()){
              $users = $evento-&gt;GetUsers();
                  foreach($users as $user){
  
                  $formulario = $form-&gt;get(&quot;tipoinvitado&quot;)-&gt;getData();
                  $userhasevento = new UserHasEvento();
                  $userhasevento-&gt;SetTipoinvitado($formulario);
                  $userhasevento-&gt;SetFechainscripcion(new \DateTime('now'));
                  $userhasevento-&gt;SetEventoid($evento-&gt;getId());
                  $userhasevento-&gt;SetUserid($user-&gt;getId());
                  $em = $this-&gt;getDoctrine()-&gt;getManager();
                  $em-&gt;persist($userhasevento);
                  $em-&gt;flush();
              }
                  return $this-&gt;redirect($this-&gt;generateUrl('evento_detalle', ['id' =&gt; $evento-&gt;getId()]));
   
          }        
          return $this-&gt;render('evento/AsignarEvento.html.twig',[
              'form' =&gt; $form-&gt;createView()
          ]);
      }
  </code></pre>
  <p>my form</p>
  <pre><code>use App\Entity\User;
  
  class AsignarEventoFormType extends AbstractType{
      
      public function buildForm(FormBuilderInterface $builder, array $options){
          $builder-&gt;add('Users', EntityType::class, [
              'class' =&gt; User::class,
              'multiple' =&gt; true,
  
          ])
  
          -&gt;add('tipoinvitado', ChoiceType::class, array(
              'label' =&gt; 'Prioridad',
              'choices' =&gt; array(
                  'VIP' =&gt; 'VIP',
                  'Empresa' =&gt; 'Empresa'
              )
          ))
  
          -&gt;add('submit', SubmitType::class, array(
              'label' =&gt; 'Asignar'
          ));
      }
      
  }```
  </code></pre>