[Deprecated] DMZ 1.5.3 (DataMapper OverZealous Edition) |
[eluser]OverZealous[/eluser]
@freshface The original DataMapper is not currently in active development. Stensi has been very busy, and unable to update it since the last release in December 2008. DMZ is a significantly enhanced version of DataMapper, containing a lot of new features. 1) DataMapper is used exclusively for mapping database tables to objects, so this is unrelated to DMZ. How you handle it is up to you. I would recommend having an extra column that stores the ‘slug’, and then you can easily query on it. 2) You don't look up data the way you are thinking. A $has_one relationship works the same as a $has_many relationship. In other words, you will usually look up the second object like this: Code: // other_object is your $has_one related model With DMZ there is an alternate method, include_related('other_object'). If you use this, then you only need one query (really important if you are looping over results), and you access related object fields as $u->other_object_name. 3) Validation is handled completely automatically with DataMapper. Please look at the documentation. The recommended method for processing an object is something like this: Code: function edit($id, $save = '') { Your view can output errors if they exist within $user->error. Please take some time to look through the very thorough documentation. |
Welcome Guest, Not a member yet? Register Sign In |