Fix problema precedenza uso dei traits

This commit is contained in:
Pek5892 2024-03-25 17:12:26 +01:00
parent dd8c2ef464
commit ab061d6f7e
4 changed files with 5 additions and 5 deletions

View File

@ -517,7 +517,7 @@ class Fattura extends Document
} }
return $this->getModule() return $this->getModule()
->uploads($this->id) ->files($this->id)
->where('id', $this->id_ricevuta_principale) ->where('id', $this->id_ricevuta_principale)
->first(); ->first();
} }

View File

@ -155,7 +155,7 @@ class Ricevuta
// Controllo sulla presenza della stessa ricevuta // Controllo sulla presenza della stessa ricevuta
$module = $fattura->getModule(); $module = $fattura->getModule();
$upload_esistente = $module $upload_esistente = $module
->uploads($fattura->id) ->files($fattura->id)
->where('original_name', $filename) ->where('original_name', $filename)
->first(); ->first();
if (!empty($upload_esistente)) { if (!empty($upload_esistente)) {

View File

@ -40,7 +40,7 @@ trait UploadTrait
return $result; return $result;
} }
public function uploadsNumber($id_record) public function files($id_record)
{ {
return $this->hasMany(Upload::class, $this->component_identifier)->where('id_record', $id_record)->get(); return $this->hasMany(Upload::class, $this->component_identifier)->where('id_record', $id_record)->get();
} }

View File

@ -58,11 +58,11 @@ trait RecordTrait
$plugin = $this->getPlugin(); $plugin = $this->getPlugin();
if (!empty($module)) { if (!empty($module)) {
return $module->uploads($this->id); return $module->files($this->id);
} }
if (!empty($plugin)) { if (!empty($plugin)) {
return $plugin->uploads($this->id); return $plugin->files($this->id);
} }
return collect(); return collect();