1
0
mirror of synced 2024-12-15 15:46:02 +03:00
doctrine2/manual/docs/Working with objects - Component overview - Connection - Getting connection state.php

20 lines
591 B
PHP
Raw Normal View History

2007-04-14 01:49:11 +04:00
Connection state gives you information about how active connection currently is. You can get the current state
by calling Doctrine_Connection::getState().
2007-04-14 01:49:11 +04:00
<code type="php">
switch($conn->getState()):
case Doctrine_Connection::STATE_ACTIVE:
// connection open and zero open transactions
break;
case Doctrine_Connection::STATE_ACTIVE:
// one open transaction
break;
case Doctrine_Connection::STATE_BUSY:
// multiple open transactions
break;
case Doctrine_Connection::STATE_CLOSED:
// connection closed
break;
endswitch;
</code>