Further regression fix with item edit and deleted flag (#672)

This commit is contained in:
FrancescoUK
2016-06-19 12:58:47 +01:00
parent c75675129b
commit a4488ec090

View File

@@ -4,11 +4,14 @@ class Item extends CI_Model
/*
Determines if a given item_id is an item
*/
public function exists($item_id, $deleted = FALSE)
public function exists($item_id, $ignore_deleted = FALSE, $deleted = FALSE)
{
$this->db->from('items');
$this->db->where('item_id', $item_id);
$this->db->where('deleted', $deleted);
if($ignore_deleted == FALSE)
{
$this->db->where('deleted', $deleted);
}
return ($this->db->get()->num_rows() == 1);
}