Beispiel #1
0
 /**
  * @Author: Jason  Apr 11, 2014
  * @Todo: only remove file of report defect
  * @Param: $modelDel is model DeportDefect
  * @Param: $nameField field file in model report
  */
 public static function removeFile($modelDel, $nameField, $pathUpload)
 {
     $ImageProcessing = new ImageProcessing();
     $ImageProcessing->folder = '/' . $pathUpload . '/' . $modelDel->id;
     $ImageProcessing->delete($ImageProcessing->folder . '/' . $modelDel->{$nameField});
     //        $ImageHelper = new ImageHelper();
     //        $ImageHelper->folder = '/'.$pathUpload;
     //        $ImageHelper->deleteFile($ImageHelper->folder . '/' . $modelRemove->$fieldName);
     //        foreach ( $aSize as $key => $value) {
     //            $ImageHelper->deleteFile($ImageHelper->folder . '/' . $key . '/' . $modelRemove->$fieldName);
     //        }
     foreach (self::$aSize as $key => $value) {
         $ImageProcessing->deleteFile($ImageProcessing->folder . '/' . $key . '/' . $modelDel->{$nameField});
     }
 }