<?php

/*
 * Copyright (c) 2018 Earworks.
 * Codeigniter Project Template Modification
 * Please contact our email for more information :
 * contact@earworks.co.id
 */
defined('BASEPATH') OR exit('No direct script access allowed');

/**
 * Description of Userrole_model
 *
 * @author Fajar Dwi Rianto <fajar@earworks.co.id>
 * @since 1.0
 */
class Userrole_model extends CI_Model {

    /**
     * define selected table name
     */
    const TABLE = 'userrole';

    public function check($input = array()) {
        $this->db->from(self::TABLE);
        if (isset($input['id']) && !empty($input['id'])) {
            $this->db->where('id', $input['id']);
        }
        if (isset($input['roleid']) && !empty($input['roleid'])) {
            $this->db->where('roleid', $input['roleid']);
        }
        return $this->db->count_all_results();
    }

}
