The exportables system by default produces objects of class stdClass, and there's provision to set this to a different class by setting 'object' in the hook_schema data.
However, this doesn't quite go far enough.
In Clients module, client connection objects have different classes depending on their type -- this is the same pattern as in Flag module, for instance.
Obviously I can work around this in my load callback like this:
$type = $result[$name]->type; $class = 'clients_connection_' . $type; // Hand the object over to the constructor which takes care of putting the // data into the handler object and any processing that needs doing. $connection = new $class((array) $result[$name]);
but it's a bit messy to have to remake the object, and also it means I have to implement my own static caching rather than rely on that in ctools_export_load_object().
What I suggest is either:
a) a 'object class callback' setting, where the callback is called with the $data before calling _ctools_export_unpack_object().
b) two settings, 'object class key' and 'object class prefix'. So in my case I would set this in my hook_schema():
'object class key' => 'type' 'object class prefix' => 'clients_connection_'
Let me know which you prefer, or another method, and I'll work on a patch :)