Esempio n. 1
0
 /**
  * Do delete action, this method should be override by sub class.
  *
  * @param mixed $conditions Where conditions, you can use array or Compare object.
  *
  * @throws \Exception
  * @return  boolean Will be always true.
  */
 protected function doDelete(array $conditions)
 {
     !$this->useTransaction ?: $this->db->transactionStart(true);
     try {
         $result = $this->db->delete($this->table, $conditions);
     } catch (\Exception $e) {
         !$this->useTransaction ?: $this->db->transactionRollback(true);
         throw $e;
     }
     !$this->useTransaction ?: $this->db->transactionCommit(true);
     return $result;
 }