diff --git a/help/export.html b/help/export.html
index 9118e72..38e4be8 100644
--- a/help/export.html
+++ b/help/export.html
@@ -105,7 +105,10 @@ function mymodule_schema() {
Objects should contain a primary key which is a database identifier primarily used to determine if an object has been written or not. This is required for the default CRUD save callback to work.
object
-The class the object should be created as. Defaults as stdClass.
+The class the object should be created as, if 'object factory' is not set. If this is not set either, defaults as stdClass.
+
+object factory
+Function used to create the object. The function receives the schema and the loaded data as a parameters: your_factory_function($schema, $data). If this is set, 'object' has no effect since you can use your function to create whatever class you wish.
can disable
Control whether or not the exportable objects can be disabled. All this does is cause the 'disabled' field on the object to always be set appropriately, and a variable is kept to record the state. Changes made to this state must be handled by the owner of the object. Defaults to TRUE.
diff --git a/includes/export.inc b/includes/export.inc
index 82f2042..a90ccfe 100644
--- a/includes/export.inc
+++ b/includes/export.inc
@@ -380,7 +380,13 @@ function ctools_export_load_object($table, $type = 'all', $args = array()) {
$status = variable_get($export['status'], array());
// Unpack the results of the query onto objects and cache them.
while ($data = db_fetch_object($result)) {
- $object = _ctools_export_unpack_object($schema, $data, $export['object']);
+ if (isset($schema['export']['object factory'])) {
+ $factory_function = $schema['export']['object factory'];
+ $object = $factory_function($schema, $data);
+ }
+ else {
+ $object = _ctools_export_unpack_object($schema, $data, $export['object']);
+ }
$object->table = $table;
$object->type = t('Normal');
$object->export_type = EXPORT_IN_DATABASE;