class Upload | class Upload | ||||
{ | { | ||||
public static function uploadFile($model, $champsFile, $champs, $filename_old = '') | |||||
public static function uploadFile($model, $champsFile, $champs, string $filename_old = null) | |||||
{ | { | ||||
$file = $model->$champsFile; | $file = $model->$champsFile; | ||||
if ($file) { | if ($file) { |
} | } | ||||
} | } | ||||
public function processUploadImage(Producer $producer, string $name, string $filenameOld, bool $deleteImage) | |||||
public function processUploadImage(Producer $producer, string $name, string $filenameOld = null, bool $deleteImage = false) | |||||
{ | { | ||||
Upload::uploadFile($producer, $name.'File', $name, $filenameOld); | Upload::uploadFile($producer, $name.'File', $name, $filenameOld); | ||||
if ($deleteImage) { | if ($deleteImage) { |