我收到此错误,无法找出原因

时间:2018-03-28 18:52:31

标签: php

  

致命错误:在第2行的C:\ xampp \ htdocs \ Cart \ app \ Basket \ Basket.php中调用null成员函数find()

public function update(Product $product, $quantity){
  if(!$this->$product->find($product->id)->hasStock($quantity)){
    //throw exception
    throw new QuantityExceededException;
    }//end if
 if($quantity == 0){
   $this->remove($product);
   return;
 }//end if
 $this->storage->set($product->id, [
   'product_id' => (int) $product->id,
    'quantity' => (int)$quantity]);
}//end function update

我收到此错误,无法弄清楚原因。我已粘贴代码。请注意我正在使用树枝。任何有关这个问题的帮助将不胜感激。

0 个答案:

没有答案
相关问题