예제 #1
0
파일: Cart.php 프로젝트: gabrieljmj/cart
 /**
  * Verifies if the chart has a kind of determined product
  *
  * @param integer|\Gabrieljmj\Cart\Product\ProductInterface $product
  * @return boolean
  */
 public function has($product)
 {
     return $product instanceof ProductInterface ? isset($this->products[$product->getId()]) : isset($this->products[$product]);
 }
예제 #2
0
 /**
  * Returns the price of all products summed
  *
  * @return integer
  */
 public function getPrice()
 {
     return $this->product->getPrice() * $this->amount;
 }