public function __call($name, $params)
{
if(method_exists(CurrencyConverter::className(), $name)){
if($params[0] == 0 || $params[0]){
call_user_func_array($name, $params);
}else{
throw new \Exception('Price must be a valid number!');
}
}
throw new NotFoundException('Function doesn\'t exist');
}
if
条件,但在此条件之后发生错误:
call_user_func_array() expects parameter 1 to be a valid callback, function 'convertPriceByGivenCurrencies' not found or invalid function name
这就是
convertPriceByGivenCurrencies
方法,该方法位于
:
protected function convertPriceByGivenCurrencies($product_price, $product_price_currency_id, $select_currency_id)
{
............
}