Move some product product\supplier and product\type::class methods into __get(), no functional changes
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user