Elcodi\Store\ProductBundle\Controller\PurchasableController::resolveVariableName PHP Метод

resolveVariableName() приватный Метод

Resolve the variable name given the purchasable instance
private resolveVariableName ( Elcodi\Component\Product\Entity\Interfaces\PurchasableInterface $purchasable ) : string
$purchasable Elcodi\Component\Product\Entity\Interfaces\PurchasableInterface Purchasable
Результат string variable name
    private function resolveVariableName(PurchasableInterface $purchasable)
    {
        if ($purchasable instanceof ProductInterface) {
            return 'product';
        }
        if ($purchasable instanceof PackInterface) {
            return 'pack';
        }
        return '';
    }