예제 #1
0
 /**
  * Do updateAll action.
  *
  * @param   mixed  $data        The data we want to update to every rows.
  * @param   mixed  $conditions  Where conditions, you can use array or Compare object.
  *
  * @throws  \Exception
  * @return  boolean
  */
 protected function doUpdateAll($data, array $conditions)
 {
     !$this->useTransaction ?: $this->db->transactionStart(true);
     try {
         $result = $this->db->updateAll($this->table, $data, $conditions);
     } catch (\Exception $e) {
         !$this->useTransaction ?: $this->db->transactionRollback(true);
         throw $e;
     }
     !$this->useTransaction ?: $this->db->transactionCommit(true);
     return $result;
 }