Merge pull request #568 from rtorralba/master

codeigniter: fixed $this->table attribute access in ci_model_crudl and removed function doc comments
This commit is contained in:
Holger Rapp 2015-04-28 07:58:37 +02:00
commit 475fd06422

View File

@ -42,14 +42,6 @@ snippet ci_model_crudl
${3:// code...} ${3:// code...}
} }
// public create(data) {{{
/**
* create
*
* @param mixed $data
* @access public
* @return boolean
*/
public function create($data) public function create($data)
{ {
if($this->db->insert($table, $data)) if($this->db->insert($table, $data))
@ -57,31 +49,12 @@ snippet ci_model_crudl
else else
return false; return false;
} }
// }}}
// public read(id) {{{
/**
* read
*
* @param int $id
* @access public
* @return boolean
*/
public function read($id) public function read($id)
{ {
return $this->db->get_where($table, array('id', $id))->result(); return $this->db->get_where($this->table, array('id', $id))->result();
} }
// }}}
// public update(id,data) {{{
/**
* update
*
* @param int $id
* @param mixed $data
* @access public
* @return boolean
*/
public function update($id, $data) public function update($id, $data)
{ {
if($this->db->update($table, $data, array('id' => $id))) if($this->db->update($table, $data, array('id' => $id)))
@ -89,16 +62,7 @@ snippet ci_model_crudl
else else
return false; return false;
} }
// }}}
// public delete(id) {{{
/**
* delete
*
* @param mixed $id (int o array of int)
* @access public
* @return boolean
*/
public function delete($id) public function delete($id)
{ {
if(is_array($id)) if(is_array($id))
@ -116,24 +80,13 @@ snippet ci_model_crudl
return false; return false;
} }
} }
// }}}
// public listRows(limit=null,offset=0) {{{
/**
* listRows
*
* @param int $limit
* @param int $offset
* @access public
* @return boolean
*/
public function listRows($limit = null, $offset = 0) public function listRows($limit = null, $offset = 0)
{ {
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($table)->result();
} }
// }}}
} }
# Load view # Load view
snippet ci_load-view snippet ci_load-view