mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-22 07:05:23 +00:00
Make associate() and setTaxRate() return self so it can be chained
This commit is contained in:
@@ -220,22 +220,26 @@ class CartItem implements Arrayable
|
||||
* Associate the cart item with the given model.
|
||||
*
|
||||
* @param mixed $model
|
||||
* @return void
|
||||
* @return \Gloudemans\Shoppingcart\CartItem
|
||||
*/
|
||||
public function associate($model)
|
||||
{
|
||||
$this->associatedModel = is_string($model) ? $model : get_class($model);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the tax rate.
|
||||
*
|
||||
* @param int|float $taxRate
|
||||
* @return void
|
||||
* @return \Gloudemans\Shoppingcart\CartItem
|
||||
*/
|
||||
public function setTaxRate($taxRate)
|
||||
{
|
||||
$this->taxRate = $taxRate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user