CakePHP: shortcomings with indirectly associated models

Posted by Dan on Stack Overflow See other posts from Stack Overflow or by Dan
Published on 2010-05-11T15:55:29Z Indexed on 2010/05/12 0:24 UTC
Read the original article Hit count: 636

I'm having some issues with dealing with indirectly associated models in cakephp. My current model setup is as follows:

Deliveries hasOne License
License belongsTo Delivery
License hasAndBelongsToMany Product (and vice-versa)
License hasAndBelongsToMany ProductOption (and vice-versa)

I'm trying to save information about ALL of these models inside ONE form. The shortcomings I'm running into are the following:

  1. The form helper only seems able to see the field type one level deep.

  2. saveAll() only seems able to save records one level deep (for multiple model forms).

I'm searching everywhere for the solutions to these issues, but since I'm new to CakePHP, I'm not sure what the newest methods or "correct" methods are for dealing with these issues.

Any advice is much appreciated. Thank you all!

EDIT: I've posted code to my failed attempt here: http://bin.cakephp.org/saved/58501

© Stack Overflow or respective owner

Related posts about cakephp

Related posts about model