From 764e06d4a34d1a68534d4e2193d6a48cbaeb2844 Mon Sep 17 00:00:00 2001 From: rtorralba Date: Tue, 28 Apr 2015 17:23:45 +0200 Subject: [PATCH] Fixed ->table attribute access --- snippets/codeigniter.snippets | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/snippets/codeigniter.snippets b/snippets/codeigniter.snippets index efd7620..c38aa4d 100644 --- a/snippets/codeigniter.snippets +++ b/snippets/codeigniter.snippets @@ -44,7 +44,7 @@ snippet ci_model_crudl public function create($data) { - if($this->db->insert($table, $data)) + if($this->db->insert($this->table, $data)) return true; else return false; @@ -57,7 +57,7 @@ snippet ci_model_crudl public function update($id, $data) { - if($this->db->update($table, $data, array('id' => $id))) + if($this->db->update($this->table, $data, array('id' => $id))) return true; else return false; @@ -69,12 +69,12 @@ snippet ci_model_crudl { $this->db->trans_start(); foreach($id as $elem) - $this->db->delete($table, array('id' => $elem)); + $this->db->delete($this->table, array('id' => $elem)); $this->db->trans_complete(); } else { - if($this->db->delete($table, array('id' => $id))) + if($this->db->delete($this->table, array('id' => $id))) return true; else return false; @@ -85,7 +85,7 @@ snippet ci_model_crudl { if(!is_null($limit)) $this->db->limit($limit, $offset); - return $this->db->get($table)->result(); + return $this->db->get($this->table)->result(); } } # Load view