From d57ee7edaa624776a347945a2a8a5987dd81753d Mon Sep 17 00:00:00 2001 From: Pek5892 Date: Tue, 5 Dec 2023 10:33:53 +0100 Subject: [PATCH] fix minore --- modules/interventi/src/Stato.php | 11 +++++++++++ src/Common/SimpleModelTrait.php | 10 ++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/modules/interventi/src/Stato.php b/modules/interventi/src/Stato.php index 5aeef4c5f..005388484 100755 --- a/modules/interventi/src/Stato.php +++ b/modules/interventi/src/Stato.php @@ -33,4 +33,15 @@ class Stato extends Model { return $this->hasMany(Intervento::class, 'idstatointervento'); } + + public static function build($nome) + { + $model = new static(); + + $model->codice = 'NEW'; + $model->descrizione = $nome; + $model->save(); + + return $model; + } } diff --git a/src/Common/SimpleModelTrait.php b/src/Common/SimpleModelTrait.php index f3ffc44ad..6c3a7b6cd 100644 --- a/src/Common/SimpleModelTrait.php +++ b/src/Common/SimpleModelTrait.php @@ -37,14 +37,8 @@ trait SimpleModelTrait * * @return static */ - public static function build($nome) + public static function build() { - $model = new static(); - - $model->codice = 'NEW'; - $model->descrizione = $nome; - $model->save(); - - return $model; + return new static(); } }