We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(Moved from ikkez/f3-cortex#90)
When we rollback a transaction, the previously saved objects stay in a valid state (valid per use of dry()/valid() functions).
dry()
valid()
I would have expected the dry() function to return true.
true
here is a little example:
$f3->get('DB')->begin(); $move = new Move(); $move->comment = 'Some comment'; var_dump(move->dry()); $move->save(); var_dump(move->dry()); $f3->get('DB')->rollback(); var_dump(move->dry());
This outputs:
bool(true) bool(false) bool(false)
But I expect it to return:
bool(true) bool(false) bool(true)
The text was updated successfully, but these errors were encountered:
That's not possible since the DB class is not aware of all the mappers relying on it.
Just call reset() when the rollback is successful:
reset()
$f3->get('DB')->rollback() && $move->reset();
Sorry, something went wrong.
No branches or pull requests
(Moved from ikkez/f3-cortex#90)
When we rollback a transaction, the previously saved objects stay in a valid state (valid per use of
dry()
/valid()
functions).I would have expected the
dry()
function to returntrue
.here is a little example:
This outputs:
But I expect it to return:
The text was updated successfully, but these errors were encountered: