Re: Does every model need a name field? Why?

2010-08-27 Thread psybear83
Thank you for the answer, Jeremy!

On 26 Aug., 10:28, Jeremy Burns | Class Outfit
jeremybu...@classoutfit.com wrote:
 Not strictly accurate - you do not need to have either a name or title field 
 in your table, but they have their uses. Cake can use a 'name' or 'title' 
 field to automatically populate lists and such. Having said that, you can 
 override it with var $displayField in your model. 
 See:http://book.cakephp.org/view/1014/Titlesfor more info.

 I prefer to stick to a name field as Cake drives convention.

 Jeremy Burns
 Class Outfit

 jeremybu...@classoutfit.comhttp://www.classoutfit.com

 On 26 Aug 2010, at 09:23, psybear83 wrote: Hi all

  I'm just digging into CakePHP and continue an application of my
  previous co-worker. He told me that every model needs a name field
  in the database. Why's that? I did a search on Google but could't find
  an answer...

  Thanks
  Josh

  Check out the new CakePHP Questions sitehttp://cakeqs.organd 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+unsubscr...@googlegroups.com For more options, visit this group 
  athttp://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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Does every model need a name field? Why?

2010-08-26 Thread psybear83
Hi all

I'm just digging into CakePHP and continue an application of my
previous co-worker. He told me that every model needs a name field
in the database. Why's that? I did a search on Google but could't find
an answer...

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


Re: Does every model need a name field? Why?

2010-08-26 Thread Robert J. Maiolo
perhaps he meant a name variable, as shown in the following example:


   1. ?php
   2. class Ingredient extends AppModel {
   3. var $name = 'Ingredient';
   4. }
   5. ?




On Thu, Aug 26, 2010 at 1:23 AM, psybear83 psybea...@gmail.com wrote:

 Hi all

 I'm just digging into CakePHP and continue an application of my
 previous co-worker. He told me that every model needs a name field
 in the database. Why's that? I did a search on Google but could't find
 an answer...

 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+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Does every model need a name field? Why?

2010-08-26 Thread Jeremy Burns | Class Outfit
Not strictly accurate - you do not need to have either a name or title field in 
your table, but they have their uses. Cake can use a 'name' or 'title' field to 
automatically populate lists and such. Having said that, you can override it 
with var $displayField in your model. See: 
http://book.cakephp.org/view/1014/Titles for more info.

I prefer to stick to a name field as Cake drives convention.

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 26 Aug 2010, at 09:23, psybear83 wrote:

 Hi all
 
 I'm just digging into CakePHP and continue an application of my
 previous co-worker. He told me that every model needs a name field
 in the database. Why's that? I did a search on Google but could't find
 an answer...
 
 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+unsubscr...@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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en