Example #1
0
 /**
  */
 public function sort($rules)
 {
     $old = $this->_filters;
     parent::sort($rules);
     $query = sprintf('UPDATE %s SET rule_order = ? WHERE rule_id = ?', $this->_params['table_rules']);
     $this->_db->beginDbTransaction();
     try {
         foreach ($this->_filters as $key => $val) {
             $this->_db->update($query, array($key, $val['id']));
         }
     } catch (Horde_Db_Exception $e) {
         $this->_db->rollbackDbTransaction();
         $this->_filters = $old;
         throw new Ingo_Exception($e);
     }
     $this->_db->commitDbTransaction();
 }