I have a custom page type with a form, on the forms action I'm updating an object:
$myObj = DataObject::get_by_id("myObj", $Id);
$myObj->myProperty = 2;
$myObj->write();
But this only updates the _Live table and not the draft table, how can I update the draft table so it shows in the CMS?
Thank you