mirror of
https://github.com/kevin-DL/LaravelShoppingcart.git
synced 2026-01-24 07:55:35 +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.
|
* Associate the cart item with the given model.
|
||||||
*
|
*
|
||||||
* @param mixed $model
|
* @param mixed $model
|
||||||
* @return void
|
* @return \Gloudemans\Shoppingcart\CartItem
|
||||||
*/
|
*/
|
||||||
public function associate($model)
|
public function associate($model)
|
||||||
{
|
{
|
||||||
$this->associatedModel = is_string($model) ? $model : get_class($model);
|
$this->associatedModel = is_string($model) ? $model : get_class($model);
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the tax rate.
|
* Set the tax rate.
|
||||||
*
|
*
|
||||||
* @param int|float $taxRate
|
* @param int|float $taxRate
|
||||||
* @return void
|
* @return \Gloudemans\Shoppingcart\CartItem
|
||||||
*/
|
*/
|
||||||
public function setTaxRate($taxRate)
|
public function setTaxRate($taxRate)
|
||||||
{
|
{
|
||||||
$this->taxRate = $taxRate;
|
$this->taxRate = $taxRate;
|
||||||
|
|
||||||
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user