[Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) |
[eluser]OverZealous[/eluser]
[quote author="Bnoe" date="1249886684"]hmm.. it will be difficult touse dmz on non english language or we adopt non english database. any suggestion?[/quote] Many people use it with non-English systems. There is no language database, DMZ just uses the inflector helper to convert the model or table name if they are not provided. If you don't use it with English, you can still specify the table name in your language. My comment was that you should stick with the recommended model/table naming scheme. Unless you have a very good reason to avoid it (usually legacy databases), it makes it easier for me (and other DMZ users) to support. There is only one location in the current DMZ where the inflector code is used without an alternate option: and that is when naming many-to-many self-relationship join tables (scroll down to Self Relationships). In this case, to ensure unique relationships, the table name is generated using plural($this->model) and plural($other->model), according to the rules linked above. So, unless you plan to use many-to-many self-relationships, you can always safely override $model and $table to be whatever you like. You are also free to write / provide your own version of inflector helper. Just replace the inflector_helper.php that comes with DMZ. (You also lose the ability to reference relationships using the plural form, such as $user->groups. But that doesn't break anything, just code readability.) |
Welcome Guest, Not a member yet? Register Sign In |