Wednesday, October 29, 2008

Turn off inflections

Hi all,

I just encountered an error in my program due to inflections.

My model is called "Uebsmwinklusive", it uses the table
"uebsmwinklusives". What happened, when I tried to use the index.ctp,
which uses arrays like: $uebsmwinklusive['Uebsmwinklusive']['id'], I get
an error "Undefined index: Uebsmwinklusive".
After some poking around I got me the array which arrives in the
index.ctp and - ahaaaaa - see there an irregular plural:
Array
(
[0] => Array
(
[Uebsmwinklusife] => Array
(
[id] => 10
[mwinklusive_id] => 1
[sprache_id] => 1 ....

Please note the [Uebsmwinklusife] instead of [Uebsmwinklusive]

In my inflections.php all my arrays are already empty:
$pluralRules = array();
$uninflectedPlural = array();
$irregularPlural = array();
$singularRules = array();
$uninflectedSingular = $uninflectedPlural;
$irregularSingular = array_flip($irregularPlural);

What can I do to get my normal rules? I remember when I baked the
application the plural rules really gave me a hard time and we decided
to have no language specific plural rules just the mold "Name" in the
model becomes "names" in the controller and database table.

Any idea where I can check to get rid of the unwanted "ife"?

By the way: My model starts like this:

class Uebsmwinklusive extends AppModel {
var $name = 'Uebsmwinklusive';
var $useTable = 'uebsmwinklusives';

Thanks a lot in advance!

Anja

--~--~---------~--~----~------------~-------~--~----~
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: