Which model doesn't have an id field?

If it has an pk or uid or some other name you should just let Cake
know via the attribute $primaryKey.
The join-table can manage without any primary key as long as you don't
store any extra data in it. But this is not encouraged, it seems to be
considered as smart as smoking cigarettes and drinking lighter-fluid
at the same time. (I tried to discuss the point a while back.)

But, since you mention a position value in the joining table you do
need an id there to make Cake happy.



On Aug 17, 12:31 am, Wilson Sheldon <[email protected]> wrote:
> Hi everyone,
>
> Anytime I save a HABTM relationship, I always get this error:
>
> Notice (8): Undefined index:  id
>
> Everything works, but of course, this is annoying when I'm not in
> production mode.  There is no plain 'id' in the model.
>
> Done a bit of research on it, and found a few others who mention it,
> but can't find answer, so just normally suppress it.
>
> I think it's related to the fact, that I often store the position in
> the join table.
>
> Has anyone experienced this?  And if so, is there a workaround or a
> better way to store the position?
>
> I've also thought it might be something to do with the index on my
> join table?
>
> Thanks,
> Wilson
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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