<?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 Profile_model
 *
 * @author Fajar Dwi Rianto <fajar@earworks.co.id>
 * @since 1.0
 */
class Profile_model extends CI_Model {

    const TABLE_NAME = 'profiles';

    public function check_user($userid = null) {
        $this->db->from(self::TABLE_NAME);
        $this->db->where('userid', $userid);
        return $this->db->count_all_results();
    }

    public function update($input = array(), $user = array()) {
        $this->db->set($input);
        $this->db->where('userid', $user['userid']);
        return $this->db->update(self::TABLE_NAME);
    }

}
