why null instead of empty arrayCollection?
<p>I have two entities with a oneToMany relationship:</p>

<p>Post entity:</p>

<pre><code>...
oneToMany:
  images:
    mappedBy: post
    targetEntity: Shop\Bundle\ManagementBundle\Entity\Image
</code></pre>

<p>Image entity:</p>

<pre><code>...
    manyToOne:
        post:
            targetEntity: Shop\Bundle\ManagementBundle\Entity\Post
            inversedBy: images
            joinColumn:
                onDelete: cascade
</code></pre>

<p>when I do <code>$entity-&gt;getImages()</code>, I receive <code>null</code>. Even if in database there are many images linked to a post.</p>

<p>I really did all my best to figure out what might cause such issue. Your usual help is much appreciated.</p>

<p><strong>PS:</strong>
Given an integer <code>$id</code>, I fetch a Post entity in controller using:</p>

<pre><code>$em = $this-&gt;getDoctrine()-&gt;getManager();
$entity = $em-&gt;getRepository('ShopManagementBundle:Post')-&gt;find($id);
</code></pre>

<p>I successfully get all the attributes of Post entity except from images. When I do <code>$entity= new Post</code>, <code>getImages</code> gives an empty arrayCollection!!.</p>

<p><strong>solution</strong>:</p>

<p><a href="https://stackoverflow.com/questions/34725409/get-child-entities-returns-null-instead-of-arraycollection-object">Get child entities returns null instead of arrayCollection object</a></p>