| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | protected function setTransactionIsolationLevel(string $level): void |
||
| 35 | { |
||
| 36 | switch ($level) { |
||
| 37 | case self::SERIALIZABLE: |
||
| 38 | $this->db->createCommand('PRAGMA read_uncommitted = False;')->execute(); |
||
| 39 | break; |
||
| 40 | case self::READ_UNCOMMITTED: |
||
| 41 | $this->db->createCommand('PRAGMA read_uncommitted = True;')->execute(); |
||
| 42 | break; |
||
| 43 | default: |
||
| 44 | throw new NotSupportedException( |
||
| 45 | self::class . ' only supports transaction isolation levels READ UNCOMMITTED and SERIALIZABLE.' |
||
| 46 | ); |
||
| 50 |