/** * Override function in order to remove required files along with database data * * @param array $conditionals * @param integer $limit */ function deleteData($conditionals, $limit = null) { $items = $this->getItems(array('filename'), $conditionals); $path = dirname(__FILE__) . '/../'; if (count($items) > 0) { foreach ($items as $item) { unlink($path . 'images/' . $item->filename); array_map('unlink', glob($path . 'thumbnails/*' . $item->filename)); } } parent::deleteData($conditionals, $limit); }
/** * Override function in order to remove required files along with database data * * @param array $conditionals * @param integer $limit */ function deleteData($conditionals, $limit = null) { $items = $this->getItems(array('filename'), $conditionals); $path = dirname(__FILE__) . '/files/'; if (count($items) > 0) { foreach ($items as $item) { unlink($path . $item->filename); } } parent::deleteData($conditionals, $limit); }