Noob: tablename singular ...y and plural ...ies ?
Hi, I just try to dig myself into cakephp and while setting up my database, I stumbled upon a question: how to handle tablenames that are written in singular with ...y and in plural ...ies, like buddy and buddies ? I assume that cakephp has just a simple pattern that plurals are singulars with an s at the end, right? How do you handle this? Is there another solution than avoiding such names? simb --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Noob: tablename singular ...y and plural ...ies ?
http://manual.cakephp.org/chapter/models $useTable If the database table you wish to use isn't the plural form of the model name (and you don't wish to change the table name), set this variable to the name of the table you'd like this model to use. On 9/6/06, simb [EMAIL PROTECTED] wrote: Hi, I just try to dig myself into cakephp and while setting up my database, I stumbled upon a question: how to handle tablenames that are written in singular with ...y and in plural ...ies, like buddy and buddies ? I assume that cakephp has just a simple pattern that plurals are singulars with an s at the end, right? How do you handle this? Is there another solution than avoiding such names? simb --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---
Re: Noob: tablename singular ...y and plural ...ies ?
On 9/6/06, simb [EMAIL PROTECTED] wrote: I assume that cakephp has just a simple pattern that plurals are singulars with an s at the end, right? Assumption is the mother of all f***ups :-) Cake can handle a much greater variety of singulars and plurals. Take a look at cake/libs/inflector.php and amaze yourself. Plus, you can always customize pluralization for anything the normal Inflector does not handle very well in app/config/inflections.php. Regards, Martin -- Martin Schapendonk, [EMAIL PROTECTED] --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~--~~~~--~~--~--~---