Fixed ->table attribute access

This commit is contained in:
rtorralba 2015-04-28 17:23:45 +02:00
parent 3ca0742a2a
commit 764e06d4a3

View File

@ -44,7 +44,7 @@ snippet ci_model_crudl
public function create($data) public function create($data)
{ {
if($this->db->insert($table, $data)) if($this->db->insert($this->table, $data))
return true; return true;
else else
return false; return false;
@ -57,7 +57,7 @@ snippet ci_model_crudl
public function update($id, $data) 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; return true;
else else
return false; return false;
@ -69,12 +69,12 @@ snippet ci_model_crudl
{ {
$this->db->trans_start(); $this->db->trans_start();
foreach($id as $elem) foreach($id as $elem)
$this->db->delete($table, array('id' => $elem)); $this->db->delete($this->table, array('id' => $elem));
$this->db->trans_complete(); $this->db->trans_complete();
} }
else else
{ {
if($this->db->delete($table, array('id' => $id))) if($this->db->delete($this->table, array('id' => $id)))
return true; return true;
else else
return false; return false;
@ -85,7 +85,7 @@ snippet ci_model_crudl
{ {
if(!is_null($limit)) if(!is_null($limit))
$this->db->limit($limit, $offset); $this->db->limit($limit, $offset);
return $this->db->get($table)->result(); return $this->db->get($this->table)->result();
} }
} }
# Load view # Load view