@jscott
Nope! However, it’s trivial to write your own. (Everyone’s application is going to be slightly different, enough so that any method used by DM is most likely going to be incorrect for your app.)
One of the things I highly recommend is to create a subclass of DataMapper (e.g.: DataMapperExt), and have all of your classes extend that instead. This way you can “extend” DataMapper without worrying about the original code.
Then just include something like this:
// warning, possibly very insecure, since anything can be passed in!
function load_from_form() {
foreach($this->fields as $field) {
$CI =& get_instance();
$v = $CI->input->post($field);
if($v !== FALSE) {
$this->{$field} = $v;
}
}
}
@warrennz
To work around the pluralizer, you very simply define $table and (if necessary) $model in your class:
class Address extends DataMapper {
$model = 'address';
$table = 'addresses';
... // rest of class
}
I think there is one other place it tries to automatically pluralize or make something singular, but I’ve never had a problem with it.
(Also, I thought that got addressed 😉 in the latest version of DataMapper’s inflector helper. Make sure you install that, as well.)