title: Could not determine access type for property "id" - HandleRequest failing unless I make the entity id public
body: <p>I have a form builder set up from a <strong>question</strong> entity:</p>
  
  <pre><code>class Question
  {
      /**
       * @ORM\Id
       * @ORM\Column(type="integer")
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      protected $id;
      /**
       * @ORM\Column(type="string", length=255, name="question")
       * @var string $question
       */
      protected $question;
      /**
       * @ORM\Column(type="string", length=255, name="answer1")
       * @var string $answer1
       */
      protected $answer1;
      /**
       * @ORM\Column(type="string", length=255, name="answer2")
       * @var string $answer2
       */
      protected $answer2;
      /**
       * @ORM\Column(type="string", length=255, name="answer3")
       * @var string $answer3
       */
      protected $answer3;
      /**
       * @ORM\Column(type="integer", name="correct_answer")
       * @var int $correctAnswer
       */
      protected $correctAnswer;
      /**
       * @ORM\Column(type="datetime", name="post_date")
       */
      protected $postDate;
      /....
  </code></pre>
  
  <p>Now the builder looks like this:</p>
  
  <pre><code> $question = new Question();
  
          $form = $this-&gt;createFormBuilder($question)
              -&gt;add('id', HiddenType::class, array(
                      'data' =&gt; 0, 
                      'attr' =&gt; array(
                          'class' =&gt; 'question-form__id'
                      )
                  )
              )
              -&gt;add('question', TextType::class, array('label' =&gt; 'Pytanie', 'required' =&gt; true))
              -&gt;add('answer1', TextType::class, array('label' =&gt; 'Odpowiedź 1', 'required' =&gt; true))
              -&gt;add('answer2', TextType::class, array('label' =&gt; 'Odpowiedź 2', 'required' =&gt; true))
              -&gt;add('answer3', TextType::class, array('label' =&gt; 'Odpowiedź 3', 'required' =&gt; true))
              -&gt;add('correctAnswer', ChoiceType::class, array(
                  'label' =&gt; 'Poprawna odpowieź',
                  'choices' =&gt; array(
                      'Pierwsza' =&gt; 1,
                      'Druga' =&gt; 2,
                      'Trzecia' =&gt; 3
                  )
              ))
              -&gt;add('save', SubmitType::class, array(
                  'label' =&gt; 'Dodaj Pytanie',
                  'attr' =&gt; array(
                      'class' =&gt; 'btn btn-primary btn--add-question'
                  )
              ))
              -&gt;getForm();
  </code></pre>
  
  <p>The reason id has data set to 0 is because the value from it will either be formed into a new question (<code>if id==0</code>) or edit a current one (<code>else</code>).</p>
  
  <p>The problem is, upon submitting the form I'm getting </p>
  
  <blockquote>
    <p>Could not determine access type for property "id"</p>
  </blockquote>
  
  <p>Playing around with <code>exit;</code> showed the error happening right at the <code>$form-&gt;handleRequest($request);</code></p>
  
  <p>The funny thing here is that if I set entities <code>id</code> as <strong>public</strong> the handleRequest works just fine.</p>
  
  <p>Tho we all know that having the id as public <em>isn't really such a good idea.</em></p>
  
  <p>So my question is how can the error be avoided without having to do probably the worst practice of all time?</p>
  
  <p><strong>EDIT:</strong> Setting the <code>id</code> value to <em>private</em> results in same error</p>