<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Model_recognition_attachment extends CI_Model {

	public function fetchAttachment($staff_id = null, $mask_id = null)
	{
		
		$this->db->select('a.*');
		if($staff_id)$this->db->where('user_id',$staff_id);
		if($mask_id)$this->db->where('mask_id',$mask_id);
		$query = $this->db->get('user__recognition_attachment a');

		return ($query->num_rows() > 0)?$query->result() : null;
	}

	public function createAttachment($input)
	{
		$this->db->insert('user__recognition_attachment',$input);

		return $this->db->insert_id();
	}

	public function editAttachment($input, $id = null)
	{
		$this->db->set($input);
		$this->db->where('id',$id);
		$this->db->update('user__recognition_attachment');
	}
}
?>