Thanks for pointing me in the right direction, I read the articles and
as soon as I inserted the habtm behavior into my code everything
worked. Thanks again.

On Jul 25, 11:32 pm, Grant Cox <[EMAIL PROTECTED]> wrote:
> I don't think HABTM saves have changed from 1.1, so you should look at
> the manual (Models, "Saving hasAndBelongsToMany Relations"), and
> search this group, it has been covered before.
>
> In your case, you will want to save something like:
> if (!empty($this->data['Artist']))
> {
>         // move the "genre_id" attribute into the Cake HABTM connection
>         $this->data['Genre']['Genre'] = array( $this->data['Artist']
> ['genre_id'] );
>
>         $this->Artist->create();
>         $result = $this->Artist->save($this->data);
>
> }
>
> Note - this is off the top of my head and I haven't used HABTM
> associations much, but I think it's about right.
>
> There have been a few helper functions made to enhance HABTM too, if
> you just want to add / remove single associations rather than redoing
> the whole 
> lot.http://bakery.cakephp.org/articles/view/alternative-methods-for-worki...http://bakery.cakephp.org/articles/view/add-delete-habtm-behavior


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to