<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/**
 * Description of rtgrid_action_model
 *
 * @author Igor Ratsun
 */
class rtgrid_action_model extends CI_Model {

    public $table;
    public $primery_key;
    public $where;

    public function delete($ids) {
        foreach ($ids as $id) {
            foreach ($this->where as $where) {
                $this->db->where($where->key, $where->value, $where->escape);
            }
            
            $this->db->
                    where($this->table . '.' . $this->primery_key, $id)->
                    delete($this->table);
        }
        
        return ($this->db->affected_rows() > 0);
    }

}

