Skip to content
New issue

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

Connection: added inTransaction() #218

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pavolbiely
Copy link

A new inTransaction() method might be a very useful shortcut.

Calling is unnecessary long right now.

/* @var \Nette\Database\Connection $db */
if ($db->getPdo()->inTransaction()) {
   $db->rollBack();
}

Why not just use it like this?

/* @var \Nette\Database\Connection $db */
if ($db->inTransaction()) {
   $db->rollBack();
}

Other shortcuts like beginTransaction(), commit() and rollback() are already implemented in Connection class.

@dg dg force-pushed the master branch 5 times, most recently from 9b70c0e to dfb79e3 Compare March 17, 2019 06:22
@dg dg force-pushed the master branch 3 times, most recently from cba566a to 302586e Compare April 1, 2019 04:56
@pavolbiely
Copy link
Author

Is there something wrong with the implementation? I could help but got no response.

@EdaCZ
Copy link
Contributor

EdaCZ commented Jul 26, 2019

@dg What do you think?

@dg
Copy link
Member

dg commented Aug 5, 2019

Please can you add simple test?

@dg dg force-pushed the master branch 2 times, most recently from 4c0e8d0 to e17242a Compare November 19, 2019 18:28
@dg dg force-pushed the master branch 6 times, most recently from f9fc19d to dd75e74 Compare December 13, 2019 18:06
@dg dg force-pushed the master branch 2 times, most recently from cce6a9c to 7e705c5 Compare December 27, 2019 03:53
@dg dg force-pushed the master branch 2 times, most recently from 9acf825 to a268c60 Compare March 27, 2020 11:52
@dg dg force-pushed the master branch 2 times, most recently from a56e7fe to d9b5f29 Compare June 9, 2020 14:19
@dg dg force-pushed the master branch 29 times, most recently from a329d1b to 9f82d9d Compare September 5, 2024 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants