From 6da49bb38b83403bf1a7f6e040ca476c6a4169f3 Mon Sep 17 00:00:00 2001 From: rtorralba Date: Thu, 23 Apr 2015 17:04:57 +0200 Subject: [PATCH] fixed $this->table attribute access --- snippets/codeigniter.snippets | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/snippets/codeigniter.snippets b/snippets/codeigniter.snippets index 0fabcc5..798805e 100644 --- a/snippets/codeigniter.snippets +++ b/snippets/codeigniter.snippets @@ -44,17 +44,17 @@ snippet ci_model_complet public function getRows() { - return $this->db->get($table)->result(); + return $this->db->get($this->table)->result(); } public function getRow($id) { - return $this->db->get_where($table, array('id', $id))->result(); + return $this->db->get_where($this->table, array('id', $id))->result(); } public function insert($data) { - if($this->db->insert($table, $data)) + if($this->db->insert($this->table, $data)) return true; else return false; @@ -62,7 +62,7 @@ snippet ci_model_complet public function update($id, $data) { - if($this->db->where('id', $id)->update($table, $data)) + if($this->db->where('id', $id)->update($this->table, $data)) return true; else return false;