title: CakePHP - How to save single hasMany through record with many belongsTo records per hasMany at once?
body: <p>My models are essentially</p>
  
  <ul>
  <li>owner hasOne album</li>
  <li>asset hasMany album</li>
  <li>album belonsTo owner</li>
  <li>album belongsTo asset</li>
  </ul>
  
  <p>A record in 'album' associates an asset to an owner, a 'link', containing extra information such as position, just as the cakephp example does here: <a href="http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html#hasmany-through-the-join-model/" rel="nofollow" title="hasMany through &#40;The Join Model&#41;">hasMany through (The Join Model)</a>. Two problems - the docs demo saving via the hasMany/relationship controller, not either end, and in my case, the first model has one record, and the latter has many (in a single save).</p>
  
  <p>When isolated, I can upload multiple assets in one form. The controller then calls saveManyIndividually(), a method inside the asset model, which uploads each asset with a corresponding DB record with a loop.</p>
  
  <p>I'd like to do this when creating a new owner, so the owner form allows multiple assets to be uploaded (with corresponding records saved at once). Then an album (link) record needs to be created per asset record, with the foreign keys being the one, single owner_id through all, and a different asset_id in each.</p>
  
  <p>I can't see a sure way of saveAssociated in the Owner controller doing this. Maybe I could use the asset->saveManyIndividually method in the beforeSave?</p>
  
  <p>I can further clarify is this is unclear.</p>