@Jeremy:

I think you misunderstood me. My point was that both the array-source
and a db-table are good solutions to the problem and that you don't
*need* to have your unique key be meaningless in either. You can use a
'slug' type of key in the array source or a unique key constraint on
the data in the table in such a way that you never have to deal with a
meaningless foreign_key.

Also - if you were doing an iphone app why wouldn't you just REST
enable your Cake app and build it out using something like Sencha
Touch or jQuery mobile? Which frontend doesn't dictate your backend
unless you were talking about native apps? Also - there is a million
reasons a model might not have a table. That might be the only thing I
*disagree* with you about.

On May 20, 4:16 am, djogo <djogopat...@gmail.com> wrote:
> > "What does '3' mean? Let's go and look in the code - oops, I don't know how 
> > to."
>
> not only this. Suppose you need to add the #4 record - or maybe change
> something on the #3.
>
> the array datasource is, IMO, the right answer for this problem. It
> allows to keep the data where it belongs, in the M of MVC. however, as
> jeremy pointed out, if your data is going to live outside cakephp,
> problems arise.
>
> Sometimes, for this kind of problem, I use varchar keys, so instead of
> having autoincremental ids, I have readable things. InnoDB is ok with
> that, and performance in a 500Mb database is good. Don't mentioning
> the code - it's SO much better to write
>
> $data = $this->Model->find('all', array( 'conditions' =>
> array( 'type_id' => 'unconfirmed' ) ) );
>
> than 'type_id' => 1.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to