private resolveVariableName ( Elcodi\Component\Product\Entity\Interfaces\PurchasableInterface $purchasable ) : string | ||
$purchasable | Elcodi\Component\Product\Entity\Interfaces\PurchasableInterface | Purchasable |
return | string | variable name |
private function resolveVariableName(PurchasableInterface $purchasable)
{
if ($purchasable instanceof ProductInterface) {
return 'product';
}
if ($purchasable instanceof PackInterface) {
return 'pack';
}
return '';
}