Example #1
0
 /**
  * Begins a transaction
  * @return void
  */
 function begin()
 {
     $query = array();
     $query[] = 'START TRANSACTION';
     if ($this->isolationLevel) {
         $query[] = ' ' . $this->isolationLevel->toDialectString($this->db->getDialect());
     }
     if ($this->mode) {
         $query[] = ' ' . $this->mode->toDialectString($this->db->getDialect());
     }
     $this->db->sendQuery(new RawSqlQuery(join(' ', $query)));
     $this->isStarted = true;
     $this->isCommited = false;
     $this->isRolledBack = false;
 }
 /**
  * @return Queue
  **/
 public function run(DB $db)
 {
     $db->queryRaw($this->toDialectString($db->getDialect()));
     return $this;
 }