On Tue, Aug 24, 2010 at 7:57 PM, DerBjörn <[email protected]> wrote: > Thanks j, > > for your example and your suggestions. > I think I will go with the tinyint. What about the idea to use > is_state_capital and is_capital? Wouldnt this solve the problem?
This looks like it's getting really complicated for nothing. These tinyint columns seem like a bad hack. As I mentioned earlier, you can do this simply with virtual models, NationalCapital and StateCapital. Each would use classname City. > Can a city be capital of a country and not of its state? I dont think > so. Can it? cause then one tinyint with 1 as state capital and 2 as > capital of country would be enough. and an unique key(state_id, > is_capital)... Of course it can. Ottawa is a good example. Toronto is the Ontario provincial capital. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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
