I cant seem to get the __construct to write to the db. It gets stuck in a recursive loop creating db rows.

Is there a simple elegant fix for this? It seems like it would be a really common use case. I know I could just call the method CompletedOrder::create($order) but syntactically that doesnt work as well. Now the loop looks like this:

The default dataobject __construct defines a lot of functionality (take a look!) so you will need to at least call parent::__construct() as well. You should also keep the same arguments as the dataobject.php file to ensure you don't break anything.

I would potentially recommend not using __construct. Perhaps have a setOrder function.