get_object_vars returns NULL
<p>This line:</p>

<pre><code>var_dump($data['department']);
</code></pre>

<p>returns this:</p>

<pre><code>object(Penny\HomeBundle\Entity\Department)[1420]
  protected 'id' =&gt; int 37
  protected 'name' =&gt; string 'Support' (length=7)
  protected 'email' =&gt; string 'denis_nizetic@hotmail.com' (length=25)
</code></pre>

<p>When I try to do </p>

<pre><code>var_dump(get_object_vars($data['department']));
</code></pre>

<p>I get</p>

<pre><code>array
  empty
</code></pre>

<p>I have no idea why does this happen if the object is there.</p>

<p>Edit: I fixed my problem with using $obj->getValue() methods (getters).</p>

<p>But the question is still there: why won't get_object_vars() work?</p>
