Transaction::commit()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Pixie\QueryBuilder;
4
5
class Transaction extends QueryBuilderHandler
6
{
7
    /**
8
     * Commit the database changes
9
     *
10
     * @throws TransactionHaltException
11
     */
12
    public function commit(): void
13
    {
14
        $this->dbInstance->query('COMMIT');
15
        throw new TransactionHaltException();
16
    }
17
18
    /**
19
     * Rollback the database changes
20
     *
21
     * @throws TransactionHaltException
22
     */
23
    public function rollback(): void
24
    {
25
        $this->dbInstance->query('ROLLBACK');
26
        throw new TransactionHaltException();
27
    }
28
}
29