That's not the behavior I'm seeing on 3.8 with PostgreSQL database.
After
calling insert() or update(), I'm left with a dry object and I have to
explicitly load the record from the DB against using the value provided
by $object->_id
Here's an example:
$newLogin = new \LoginModel(); // Extends DB\SQL\Mapper
$newLogin->username = 'foo';
$newLogin->resetVerificationState(); // Method to calculate some default values on other columns
$newLogin->insert();
// $newLogin is now dry; I have to load the record again manually to hydrate it with data:
$newLogin->loadById($newLogin->_id);
I
do normally have a method to override the insert() method of
\DB\SQL\Mapper (which ultimately calls parent::insert() after some data
sanity checks), but I removed that to test this code and I get that same
same behaviour - dry() returns true after insert()
Assigning
the return value of insert() to another variable (ie "$foo =
$newLogin->insert()") also results in a dry mapper object.