| @@ 929-943 (lines=15) @@ | ||
| 926 | * |
|
| 927 | * @return bool |
|
| 928 | */ |
|
| 929 | public function trans_commit() |
|
| 930 | { |
|
| 931 | if ( ! $this->trans_enabled OR $this->_trans_depth === 0) |
|
| 932 | { |
|
| 933 | return FALSE; |
|
| 934 | } |
|
| 935 | // When transactions are nested we only begin/commit/rollback the outermost ones |
|
| 936 | elseif ($this->_trans_depth > 1 OR $this->_trans_commit()) |
|
| 937 | { |
|
| 938 | $this->_trans_depth--; |
|
| 939 | return TRUE; |
|
| 940 | } |
|
| 941 | ||
| 942 | return FALSE; |
|
| 943 | } |
|
| 944 | ||
| 945 | // -------------------------------------------------------------------- |
|
| 946 | ||
| @@ 952-966 (lines=15) @@ | ||
| 949 | * |
|
| 950 | * @return bool |
|
| 951 | */ |
|
| 952 | public function trans_rollback() |
|
| 953 | { |
|
| 954 | if ( ! $this->trans_enabled OR $this->_trans_depth === 0) |
|
| 955 | { |
|
| 956 | return FALSE; |
|
| 957 | } |
|
| 958 | // When transactions are nested we only begin/commit/rollback the outermost ones |
|
| 959 | elseif ($this->_trans_depth > 1 OR $this->_trans_rollback()) |
|
| 960 | { |
|
| 961 | $this->_trans_depth--; |
|
| 962 | return TRUE; |
|
| 963 | } |
|
| 964 | ||
| 965 | return FALSE; |
|
| 966 | } |
|
| 967 | ||
| 968 | // -------------------------------------------------------------------- |
|
| 969 | ||