| @@ 937-951 (lines=15) @@ | ||
| 934 | * |
|
| 935 | * @return bool |
|
| 936 | */ |
|
| 937 | public function trans_commit() |
|
| 938 | { |
|
| 939 | if ( ! $this->trans_enabled OR $this->_trans_depth === 0) |
|
| 940 | { |
|
| 941 | return FALSE; |
|
| 942 | } |
|
| 943 | // When transactions are nested we only begin/commit/rollback the outermost ones |
|
| 944 | elseif ($this->_trans_depth > 1 OR $this->_trans_commit()) |
|
| 945 | { |
|
| 946 | $this->_trans_depth--; |
|
| 947 | return TRUE; |
|
| 948 | } |
|
| 949 | ||
| 950 | return FALSE; |
|
| 951 | } |
|
| 952 | ||
| 953 | // -------------------------------------------------------------------- |
|
| 954 | ||
| @@ 960-974 (lines=15) @@ | ||
| 957 | * |
|
| 958 | * @return bool |
|
| 959 | */ |
|
| 960 | public function trans_rollback() |
|
| 961 | { |
|
| 962 | if ( ! $this->trans_enabled OR $this->_trans_depth === 0) |
|
| 963 | { |
|
| 964 | return FALSE; |
|
| 965 | } |
|
| 966 | // When transactions are nested we only begin/commit/rollback the outermost ones |
|
| 967 | elseif ($this->_trans_depth > 1 OR $this->_trans_rollback()) |
|
| 968 | { |
|
| 969 | $this->_trans_depth--; |
|
| 970 | return TRUE; |
|
| 971 | } |
|
| 972 | ||
| 973 | return FALSE; |
|
| 974 | } |
|
| 975 | ||
| 976 | // -------------------------------------------------------------------- |
|
| 977 | ||