title: symfony: Form inside of another form gets author (article)
body: <p>object <code>Article</code> has </p>
  
  <pre><code> /**
   * @var Collection
   * @ORM\OneToMany(targetEntity="AppBundle\Entity\Photo", mappedBy="article", cascade={"persist"})
   */
  private $photos;
  </code></pre>
  
  <p>object <code>Photo</code> on its side has</p>
  
  <pre><code>/**
   * @var Article
   * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Article", inversedBy="photos")
   */
  private $article;
  </code></pre>
  
  <p>I have a form of an object <code>Article</code>, which contains the object <code>Photo</code>' form as follows: </p>
  
  <pre><code>//article form building
  -&gt;add('photos', CollectionType::class, [
              'allow_delete' =&gt; true,
              'allow_add' =&gt; true,
              'entry_type' =&gt; PhotoType::class,
              'entry_options' =&gt; [
                  'label' =&gt; false,
              ]
          ])
  </code></pre>
  
  <p>in my <code>PhotoType</code> I have</p>
  
  <pre><code>/**
   * {@inheritdoc}
   */
  public function buildForm(FormBuilderInterface $builder, array $options)
  {
      $builder
          -&gt;add('image', ImageType::class, [
              'context' =&gt; 'photo',
          ])
          -&gt;add('description')
          -&gt;add('url')
  ...
  </code></pre>
  
  <p>But how do I set the <code>article</code> field in my <code>Photo</code> form? So that I could create photos with the defined <code>article_id</code> column in my table? Currently all created photos within this form have article_id NULL, in other words they don't have it set</p>