Added hosting report and enabled updating hosting details
This commit is contained in:
@@ -245,7 +245,7 @@ class Product extends Model implements IDs
|
||||
* Get our product type
|
||||
*
|
||||
* @return string
|
||||
* @todo is the test of type and type->supplied necessary?
|
||||
* @todo is the test of type and type->supplied necessary? (It seems some hosting entries have no type, are they old?)
|
||||
*/
|
||||
public function getProductTypeAttribute(): string
|
||||
{
|
||||
@@ -257,9 +257,9 @@ class Product extends Model implements IDs
|
||||
*
|
||||
* @return Model
|
||||
*/
|
||||
public function getSupplierAttribute(): Model
|
||||
public function getSupplierAttribute(): ?Model
|
||||
{
|
||||
return $this->getSuppliedAttribute()->supplier_detail->supplier;
|
||||
return $this->getSuppliedAttribute() ? $this->getSuppliedAttribute()->supplier_detail->supplier : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -267,9 +267,9 @@ class Product extends Model implements IDs
|
||||
*
|
||||
* @return Model
|
||||
*/
|
||||
public function getSuppliedAttribute(): Model
|
||||
public function getSuppliedAttribute(): ?Model
|
||||
{
|
||||
return $this->type->supplied;
|
||||
return $this->type && $this->type->supplied ? $this->type->supplied : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -401,7 +401,7 @@ class Product extends Model implements IDs
|
||||
*/
|
||||
public function hasUsage(): bool
|
||||
{
|
||||
return $this->type->hasUsage();
|
||||
return $this->type && $this->type->hasUsage();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user