title: Cake PhP 3 Saving associated data in multiples levels
body: <p>I have a data model where I register an user->customer->contactinfo->email/phone</p>
  
  <p>Each one of these are different tables with respective controllers and everything associated.</p>
  
  <p>When I try to save an user I use the following code:</p>
  
  <pre><code> $users = TableRegistry::get('Users');
          $user = $users-&gt;newEntity($data, [
              'associated' =&gt; ['Customers'],['Contactinfos'],['Phones'],['Emails']
          ]);
          $users-&gt;save($user);
  </code></pre>
  
  <p>But it only saves the user and the customer.</p>
  
  <p>This is the request data:</p>
  
  <pre><code>Array
  (
  [customers] =&gt; Array
      (
          [Customer] =&gt; Array
              (
                  [name] =&gt; stackovertest
                  [last_name] =&gt; stackovertest
                  [ssn] =&gt; stackovertest
                  [address] =&gt; stackovertest
                  [gender] =&gt; male
                  [birth] =&gt; Array
                      (
                          [year] =&gt; 2015
                          [month] =&gt; 05
                          [day] =&gt; 20
                      )
  
              )
  
      )
  
  [emails] =&gt; Array
      (
          [Email] =&gt; Array
              (
                  [email] =&gt; stackovertest@test.com
              )
  
      )
  
  [password] =&gt; stackovertest
  [phones] =&gt; Array
      (
          [Phone] =&gt; Array
              (
                  [number] =&gt; stackovertest
              )
  
      )
  
  [role_id] =&gt; 0
  [activation_code] =&gt; a026698222d0479252c2712d3d696fbcca8a766d
  [tokentime] =&gt; 1432141608
  [status] =&gt; 
  [email] =&gt; stackovertest@test.com
  [contactinfos] =&gt; Array
      (
          [contactinfo] =&gt; Array
              (
              )
  
      )
  
  )
  </code></pre>
  
  <p>Basically contactinfo table will have an id (autoincremented in the database) and the id of the customer. And each email and phone registered will have the id of the contactinfo.</p>
  
  <p>This is the $user array data:</p>
  
  <pre><code>App\Model\Entity\User Object
   (
  [new] =&gt; 1
  [accessible] =&gt; Array
      (
          [email] =&gt; 1
          [password] =&gt; 1
          [status] =&gt; 1
          [activation_code] =&gt; 1
          [tokentime] =&gt; 1
          [role_id] =&gt; 1
          [role] =&gt; 1
          [customers] =&gt; 1
      )
  
  [properties] =&gt; Array
      (
          [customers] =&gt; Array
              (
                  [0] =&gt; App\Model\Entity\Customer Object
                      (
                          [new] =&gt; 1
                          [accessible] =&gt; Array
                              (
                                  [name] =&gt; 1
                                  [last_name] =&gt; 1
                                  [ssn] =&gt; 1
                                  [gender] =&gt; 1
                                  [birth] =&gt; 1
                                  [address] =&gt; 1
                                  [user_id] =&gt; 1
                                  [user] =&gt; 1
                                  [aoffers] =&gt; 1
                                  [hoffers] =&gt; 1
                                  [poffers] =&gt; 1
                              )
  
                          [properties] =&gt; Array
                              (
                                  [name] =&gt; stackovertest
                                  [last_name] =&gt; stackovertest
                                  [ssn] =&gt; stackovertest
                                  [address] =&gt; stackovertest
                                  [gender] =&gt; male
                                  [birth] =&gt; Cake\I18n\Time Object
                                      (
                                          [time] =&gt; 2015-05-20T00:00:00+0000
                                          [timezone] =&gt; UTC
                                          [fixedNowTime] =&gt; 
                                      )
  
                              )
  
                          [dirty] =&gt; Array
                              (
                                  [name] =&gt; 1
                                  [last_name] =&gt; 1
                                  [ssn] =&gt; 1
                                  [address] =&gt; 1
                                  [gender] =&gt; 1
                                  [birth] =&gt; 1
                              )
  
                          [original] =&gt; Array
                              (
                              )
  
                          [virtual] =&gt; Array
                              (
                              )
  
                          [errors] =&gt; Array
                              (
                              )
  
                          [repository] =&gt; Customers
                      )
  
              )
  
          [password] =&gt; stackovertest
          [role_id] =&gt; 0
          [activation_code] =&gt; a026698222d0479252c2712d3d696fbcca8a766d
          [tokentime] =&gt; 1432141608
          [status] =&gt; 
          [email] =&gt; stackovertest@test.com
      )
  
  [dirty] =&gt; Array
      (
          [customers] =&gt; 1
          [password] =&gt; 1
          [role_id] =&gt; 1
          [activation_code] =&gt; 1
          [tokentime] =&gt; 1
          [status] =&gt; 1
          [email] =&gt; 1
      )
  
  [original] =&gt; Array
      (
      )
  
  [virtual] =&gt; Array
      (
      )
  
  [errors] =&gt; Array
      (
      )
  
  [repository] =&gt; Users
  )
  </code></pre>
  
  <p>You can see that it does not include the contactinfo object so it will not save it.</p>
  
  <p>How can I fix this? Or is there a different way to save multiple levels of associated data?</p>