This code will crash with TokenRow::$account_id is immutable after Row is deleted
$account = $mapper->fetchRecord(1, ['tokens']);
$token = $account->tokens->getOneBy(['type' => 'test']);
if (isValid($token)) {
$atlas->delete($token);
}
$account->modified = date('c');
$atlas->update($account);
Is this the intended behavior?
Ps.
I found out will writing this issue that I can use detachOneBy instead of getOneBy but that's not always what you want.
Ps 2.
Also found the detachDeleted method.
We should probably update the documentation with a not about this behavior
This code will crash with
TokenRow::$account_id is immutable after Row is deletedIs this the intended behavior?
Ps.
I found out will writing this issue that I can use
detachOneByinstead ofgetOneBybut that's not always what you want.Ps 2.
Also found the
detachDeletedmethod.We should probably update the documentation with a not about this behavior