Sylius\Bundle\PromotionBundle\Form\EventListener\AbstractConfigurationSubscriber::getRegistryIdentifier PHP Method

getRegistryIdentifier() protected method

protected getRegistryIdentifier ( Sylius\Component\Promotion\Model\PromotionDynamicTypeInterface $rule = null, Symfony\Component\Form\FormInterface $form ) : null | string
$rule Sylius\Component\Promotion\Model\PromotionDynamicTypeInterface
$form Symfony\Component\Form\FormInterface
return null | string
    protected function getRegistryIdentifier(PromotionDynamicTypeInterface $rule = null, FormInterface $form)
    {
        if ($rule instanceof PromotionDynamicTypeInterface && null !== $rule->getType()) {
            return $rule->getType();
        }
        if (null !== $form->getConfig()->hasOption('configuration_type')) {
            return $form->getConfig()->getOption('configuration_type');
        }
        return null;
    }