Added Missing Method

This commit is contained in:
devansh bawari 2021-02-08 14:51:59 +05:30
parent d2b032a4d1
commit 542ccf92d3
1 changed files with 16 additions and 0 deletions

View File

@ -980,4 +980,20 @@ abstract class AbstractType
return $offerLines;
}
/**
* Check in loaded saleable.
*
* @return object
*/
public function checkInLoadedSaleableChecks($product, $callback)
{
static $loadedSaleableChecks = [];
if (array_key_exists($product->id, $loadedSaleableChecks)) {
return $loadedSaleableChecks[$product->id];
}
return $loadedSaleableChecks[$product->id] = $callback($product);
}
}