Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trigger after_get for each row #238

Open
wants to merge 1 commit into
base: version-3.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Trigger after_get for each row
s0x authored Apr 18, 2017
commit 6ff0a3220a92d865c5337be2f72560751a6bbe9f
5 changes: 4 additions & 1 deletion core/MY_Model.php
Original file line number Diff line number Diff line change
@@ -1003,7 +1003,10 @@ public function get_all($where = NULL)
if($query->num_rows() > 0)
{
$data = $query->result_array();
$data = $this->trigger('after_get', $data);
for ($i = 0; $i < count($data); $i++) {
$last = $i == count($data)-1;
$data[$i] = $this->trigger('after_get', $data[$i], $last);
}
$data = $this->_prep_after_read($data,TRUE);
$this->_write_to_cache($data);
return $data;