public function calculate($price, $unitTax, $quantity = 0)
    {
        $this->Tax = $unitTax * $quantity;
        $this->Total = $this->Tax + ($quantity * $price);

        return $this;
    }
public function calculate($price, $unitTax, $quantity = 0)
    {
        $this->Tax = $unitTax * $quantity;
        $this->Total = $this->Tax + ($quantity * $price);

        return $this;
    }
public function calculate ( $ price , $ unitTax , $ quantity = 0 ) { $ this -> Tax = $ unitTax * $ quantity ; $ this -> Total = $ this -> Tax + ( $ quantity * $ price ) ; return $ this ; }
Used to set the line item's values so that the total and tax add up correctly.

@param int $price
@param int $unitTax
@param int $quantity

@return $this
Used to set the line item s values so that the total and tax add up correctly .