Also note that you need saveAll(), not just save() ... it would seem.
> Apologies if this has been answered elsewhere; a reasonably thorough
> search of this group and of the CakePHP docs yielded no useful
> results.
> I've got an app that categorizes board games; it pulls data via XML
> feed from an external site. My models are such that Game is the
> "master" model, and it goes thusly:
> Game HABTM Artist
> Game HABTM Category
> Game HABTM Designer
> ...and so on.
> For a particular game, there can exist multiple artists, multiple
> categories, and so on. For example, the game "Die Macher" has only
> one designer, but three publishers and several categories.
> I'm able to put the artist/category/designer data into the appropriate
> tables as needed. What I can't seem to figure out is how to properly
> construct my $this->data array so that I can save the artists_games
> HABTM linkages.
> Am I close with something like this?
> $this->data['Game'] = array
> (
> 'Artist' => array('Artist.id' => $artist_id, 'Game.id' => $game_id),
> 'Category' => array('Category.id' => $category_id, 'Game.id' =>
> $game_id),
> ...
> );
> The documentation has everything coming in from a form; my app has
> everything coming in from XML--thus, I need to manually create $this-
> >data.
> Incidentally: my baked view for /game/add/ have what look like multi-
> select boxes for Artist/Category/etc., but no data inside. Did I miss
> something somewhere?
> Many thanks for any assistance you can provide.