Source of file ElectronicDownloadProductCleanUp.php
Size: 0,648 Bytes - Last Modified: 2021-12-23T10:40:45+00:00
/var/www/docs.ssmods.com/process/src/code/tasks/ElectronicDownloadProductCleanUp.php
123456789101112131415161718192021222324 | <?php class ElectronicDownloadProductCleanUp extends BuildTask { protected $title = "Remove expired downloads from the download folder."; protected $description = "Removes all the expired downloads from the download folder."; public function run($request) { $items = ElectronicDelivery_OrderLog::get()->filter(array("Completed" => 0)); foreach ($items as $item) { if ($item->IsExpired()) { //a simple write will take care of all the deletion process... $item->deleteFolderIfExpired(); } else { //do nothing } } } } |