_determine_key_field_value

edited January 2016 in Bug Reports
I was trying to delete an image thats uploaded against a record using:

public function on_before_delete($where) { $id = $this->_determine_key_field_value($where); $data = $this->find_by_key($id); $files[] = assets_server_path('projects/'.$data->image, 'images'); foreach($files as $file) { if (file_exists($file)) { @unlink($file); } } }

But i found that i needed to use this line in the function

$id = $this->_determine_key_field_value(array('id'=>$where['posts.id']));

not sure if it's a bug in _determine_key_field_value() in MY_Model

Comments

Sign In or Register to comment.