Skip to content

Commit

Permalink
a getAll() call, to just return all rows of a the specific table (wit…
Browse files Browse the repository at this point in the history
…h conditions specified as you make the call)
  • Loading branch information
manavo committed Apr 11, 2012
1 parent 721d139 commit 43d3912
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions MY_Model.php
Expand Up @@ -380,6 +380,14 @@ public function _load_by_something($field, $val) {
return false;
}

function getAll($where = null) {
if ($where) {
$this->_CI->db->where($where);
}
$query = $this->_CI->db->get($this->_table);
return $query->result();
}

function save() {
if ($this->_magic_timestamps == true) {
$this->{$this->_magic_timestamp_updated} = time();
Expand Down

0 comments on commit 43d3912

Please sign in to comment.