title: ZF2, Apigility with Doctrine and Embedded Atributes issue
body: <p>I'm trying to fetch some data using two nested queries through two doctrine repos:</p>
  
  <pre><code>$user = $this-&gt;_objectManager-&gt;getRepository('\Application\Entity\User')-&gt;
  findOneBy(array("hash" =&gt; $data));
  $id_user = $user-&gt;getId();
  $user_credits = $this-&gt;_objectManager-&gt;getRepository('\Application\Entity\UserCredits')-&gt;
  findOneBy(array("user_id" =&gt; $id_user));
  return $user_credits;
  </code></pre>
  
  <p>I apply some Hydrators in the module.config.php:</p>
  
  <pre><code>'Application\\Entity\\User' =&gt; array(
                  'entity_identifier_name' =&gt; 'id',
                  'route_name' =&gt; 'client-api.rest.getcredits',
                  'route_identifier_name' =&gt; 'getcredits_id',
                  'hydrator' =&gt; 'Zend\\Stdlib\\Hydrator\\ArraySerializable',
              ),
              'Application\\Entity\\UserCredits' =&gt; array(
                  'entity_identifier_name' =&gt; 'credits',
                  'route_name' =&gt; 'client-api.rest.getcredits',
                  'route_identifier_name' =&gt; 'getcredits_id',
                  'hydrator' =&gt; 'Zend\\Stdlib\\Hydrator\\ArraySerializable',
              ),
  </code></pre>
  
  <p>And in each doctrine Entity I configure the getArrayCopy() like this:</p>
  
  <p>User:</p>
  
  <pre><code>public function getArrayCopy()
      {
          return array(
              'id'=&gt;$this-&gt;getId(),
              'phone'=&gt;$this-&gt;getPhone(),
          );
      }
  </code></pre>
  
  <p>UserCredits:</p>
  
  <pre><code> public function getArrayCopy()
      {
          return array(
              'id'=&gt;$this-&gt;getUser(),
              'credits'=&gt;$this-&gt;getCredits(),
          );
      }
  </code></pre>
  
  <p>And here is the result:</p>
  
  <pre><code>{"credits":100,"_embedded":{"id":{"id":10,"phone":123456789,"_links":{"self":{"href":"http:\/\/testserver.test\/getcredits\/10"}}}},"_links":{"self":{"href":"http:\/\/testserver.test\/getcredits\/100"}}}
  </code></pre>
  
  <p>But I actually would like a result something like:</p>
  
  <pre><code>{"credits":100,"id":10},"_links":......
  </code></pre>
  
  <p><strong>How can I make this possible?
  Why ID is embedding into it?</strong></p>