title: Doctrine entity object to array
body: <p>Wants to convert doctrine entiry object to normal array, this is my code so far,</p>
  
  <pre><code> $demo = $this-&gt;doctrine-&gt;em-&gt;find('Entity\User',2);
  </code></pre>
  
  <p>Getting entity object ,</p>
  
  <pre><code>Entity\User Object
  (
  [id:Entity\User:private] =&gt; 2
  [username:Entity\User:private] =&gt; TestUser
  [password:Entity\User:private] =&gt; 950715f3f83e20ee154995cd5a89ac75
  [email:Entity\User:private] =&gt; test@test.com
  [firm_id:Entity\User:private] =&gt; Entity\Firm Object
      (
          [id:Entity\Firm:private] =&gt; 16
          [company_name:Entity\Firm:private] =&gt; TestFirm
          [company_detail:Entity\Firm:private] =&gt; India
          [created_at:Entity\Firm:private] =&gt; DateTime Object
              (
                  [date] =&gt; 2014-08-01 18:16:08
                  [timezone_type] =&gt; 3
                  [timezone] =&gt; Europe/Paris
              )
  
          [user:Entity\Firm:private] =&gt; 
      )
  
  [created_at:Entity\User:private] =&gt; DateTime Object
      (
          [date] =&gt; 2014-08-01 15:12:36
          [timezone_type] =&gt; 3
          [timezone] =&gt; Europe/Paris
      )
  
  [updated_at:Entity\User:private] =&gt; DateTime Object
      (
          [date] =&gt; 2014-08-01 15:12:36
          [timezone_type] =&gt; 3
          [timezone] =&gt; Europe/Paris
      )
  
  [firm:protected] =&gt; 
  ) ,
  </code></pre>
  
  <p>Tried <a href="https://stackoverflow.com/questions/7259256/how-to-get-a-doctrine2-result-object-as-an-associative-array">this</a> ,But as per my requiremnet do not want to user doctrine_query.
  Thanks.</p>