Move some product product\supplier and product\type::class methods into __get(), no functional changes

This commit is contained in:
2025-05-22 18:17:27 +10:00
parent 72b11172c8
commit 251aefa947
11 changed files with 46 additions and 77 deletions

View File

@@ -16,11 +16,13 @@ final class Domain extends Type
// The model of the product that is supplied by this model
const ProductModel = ProductDomain::class;
/* INTERFACES */
public function getNameAttribute(): string
public function __get($key): mixed
{
return sprintf('%s: %s',$this->product_id,$this->tld->name);
return match ($key) {
'name' => sprintf('%s: %s',$this->product_id,$this->tld->name),
default => parent::__get($key),
};
}
/* STATIC */