/** * Init all the thumbs fo a given parent * * @param string parent type * @param string parent ID * * @TODO : Improve the errors management * */ public function init_thumbs_for_parent($parent, $id_parent) { $pictures = $this->media_model->get_list($parent, $id_parent, 'picture'); foreach ($pictures as $picture) { try { $this->medias->delete_thumbs($picture); } catch (Exception $e) { // Fail message $this->error($e->getMessage()); return; } } // Everything's OK $this->success(lang('ionize_message_operation_ok')); }