More Product Model optimisation
This commit is contained in:
@@ -118,31 +118,6 @@ final class Broadband extends Type implements ProductItem
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* The product contract term is the highest of
|
||||
* + This defined contract_term
|
||||
* + The suppliers contract_term
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getContractTermAttribute(): int
|
||||
{
|
||||
return max($this->attributes['contract_term'],$this->supplied->getContractTermAttribute());
|
||||
}
|
||||
|
||||
public function getCostAttribute(): float
|
||||
{
|
||||
abort(500,'deprecated');
|
||||
// @todo Tax shouldnt be hard coded
|
||||
return ($this->supplied->base_cost+$this->allowance_cost())*1.1;
|
||||
}
|
||||
|
||||
public function getSupplierAttribute()
|
||||
{
|
||||
abort(500,'deprecated');
|
||||
return $this->getRelationValue('supplier');
|
||||
}
|
||||
|
||||
public function hasUsage(): bool
|
||||
{
|
||||
return TRUE;
|
||||
|
Reference in New Issue
Block a user