Thursday, November 4, 2010

Re: Does every model really need a "name" field? --psybear

var $name = 'ClassName'; is only needed for PHP 4.

and 

var $useTable; is only needed if your class name does not match the singular version of table name.


--
Larry E. Masters


On Thu, Nov 4, 2010 at 7:15 AM, Almudena Garcia <garcia.fraile@gmail.com> wrote:
You don't need that in the DB, what you need is in the model... 

class Job extends AppModel {
var $name = 'Job';
var $useTable = 'jobs';

.....

They can or can't match, as you wish...
Is this what you mean??


2010/11/4 psybear83 <psybear83@gmail.com>

Hi everybody

A collegue told me some time ago, that every CakePHP model needs a
"name" field in the database. However, he couldn't really tell me
why's that, and I don't really find too much information about that.
So maybe this isn't true (anymore)?

Or if it's really the case, then what do you guys do, when you really
don't want/need a name for a specific model? Invent some imaginary
name field?

Thanks
Josh

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: