Spot on, that's how I would do it. Avoids the expensive (and non- scaling by table size) updateAll. This way when you change the default image, you only have one field in one record to change, rather than 1 field in N records where N might possibly be a very big number.
Steve On Jan 18, 7:13 pm, Goranche <[EMAIL PROTECTED]> wrote: > One way of doing this is to add a "defaultPhotoID" field to the photo > gallery record... > (and of course removing the "default" flag from the photos) > > a nice side effect is that it allows you to share photos between > galleries... maybe not something that one would do, but replace the > gallery with group and photo with articles... or just about any other > example :) > > I also like to ask questions like: default photo is an attribute of > which entity? photo or gallery? > > Goran > > Jaime wrote: > > is set in the Photo model. Of course one and only one photo within > > that album should have the "default" bit set, because it's non-sense > > to flag more than one for the same album. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
