Re: Inflections problem?
Can anyone provide an example inflections configuration that would override 'data' -- 'datum to 'data' -- 'data'? In version 1.2 of inflections.php, I see the comment: /** * This is a key only array of plural words that should not be inflected. * Notice the last comma * * $uninflectedPlural = array('.*[nrlm]ese', '.*deer', '.*fish', '.*measles', '.*ois', '.*pox'); */ First off, what am I noticing about the last comma? When creating an array, you delimit your list with commas...what's significant about the last one? I have a table name sp_data and when I use the bake command to bake my model, it shows up as SpDatum. Everything I've tried in inflections.php doesn't work. Please help. --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Re: Inflections problem?
On 3/2/07, Petry [EMAIL PROTECTED] wrote: Hi people, I'm a brazilian developer an I have a problem with singular and plural rules: The word Noticia the plural form is Noticias (words ending by ia, the plural form is ias) The word Album the plural form is Albuns (words ending by m, the plural form is ns) Well for these cases, I've create in inflections.php two rules: $pluralRules = array('/(.*)m$/i' = '\1ns', '/(.*)ia$/i' = '\1ias'); $singularRules = array('/(.*)ns$/i' = '\1m','/(.*)ias$/i' = '\1a'); but when I create the MVC files with bake, for the word Noticia, bake writes Noticium Why can i fix this problem? I think that, apart from the rules that you specify, there are also some default rules.For example, i've noticed that 'data' is turned into 'datum' , which is very similar to what happens to your 'noticia'--'noticium'. I might be mistaken (becuse i'm a newbie and have very little understanding on the CakePHP internals) but : probably the inflector is using the first rule it finds , and for 'noticia' it happens to apply some default rule instead of the one that you've specified. Have you tried to add to irregularPlurals 'noticia'='noticias' ? The words defined this way are supposed to bypass the rules. -- Adrian Maier --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---
Inflections problem?
Hi people, I'm a brazilian developer an I have a problem with singular and plural rules: The word Noticia the plural form is Noticias (words ending by ia, the plural form is ias) The word Album the plural form is Albuns (words ending by m, the plural form is ns) Well for these cases, I've create in inflections.php two rules: $pluralRules = array('/(.*)m$/i' = '\1ns', '/(.*)ia$/i' = '\1ias'); $singularRules = array('/(.*)ns$/i' = '\1m','/(.*)ias$/i' = '\1a'); but when I create the MVC files with bake, for the word Noticia, bake writes Noticium Why can i fix this problem? Petry www.mdpetry.net --~--~-~--~~~---~--~~ 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?hl=en -~--~~~~--~~--~--~---