20 lines
489 B
PHP
20 lines
489 B
PHP
<?php
|
|
|
|
namespace Ulmus\Common\PdoObject;
|
|
|
|
class SqlitePdoObject extends SqlPdoObject
|
|
{
|
|
public function beginTransaction(): bool
|
|
{
|
|
if ( 0 === ++$this->openedTransaction ) {
|
|
return $this->beginImmediateTransaction();
|
|
}
|
|
|
|
return $this->exec('SAVEPOINT transaction_'.$this->openedTransaction) !== false;
|
|
}
|
|
|
|
protected function beginImmediateTransaction(): bool
|
|
{
|
|
return $this->exec("BEGIN IMMEDIATE TRANSACTION") !== false;
|
|
}
|
|
} |