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.

@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?

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.

None yet

3 participants