本文整理汇总了PHP中Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType类的典型用法代码示例。如果您正苦于以下问题:PHP AbstractResourceType类的具体用法?PHP AbstractResourceType怎么用?PHP AbstractResourceType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AbstractResourceType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param string $dataClass
* @param array $validationGroups
* @param string $attributeChoiceType
* @param RepositoryInterface $attributeRepository
* @param FormTypeRegistryInterface $formTypeTypeRegistry
*/
public function __construct($dataClass, array $validationGroups, $attributeChoiceType, RepositoryInterface $attributeRepository, FormTypeRegistryInterface $formTypeTypeRegistry)
{
parent::__construct($dataClass, $validationGroups);
$this->attributeChoiceType = $attributeChoiceType;
$this->attributeRepository = $attributeRepository;
$this->formTypeRegistry = $formTypeTypeRegistry;
}
示例2: setDefaultOptions
/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
parent::setDefaultOptions($resolver);
$resolver->replaceDefaults(array('empty_data' => function (FormInterface $form) {
return new $this->dataClass($form->get('product')->getData(), $form->get('type')->getData());
}));
}
示例3: __construct
/**
* @param string $dataClass
* @param array $validationGroups
* @param ServiceRegistryInterface $calculatorRegistry
* @param ServiceRegistryInterface $checkerRegistry
* @param FormRegistryInterface $formRegistry
*/
public function __construct($dataClass, array $validationGroups, ServiceRegistryInterface $calculatorRegistry, ServiceRegistryInterface $checkerRegistry, FormRegistryInterface $formRegistry)
{
parent::__construct($dataClass, $validationGroups);
$this->calculatorRegistry = $calculatorRegistry;
$this->checkerRegistry = $checkerRegistry;
$this->formRegistry = $formRegistry;
}
示例4: __construct
/**
* @param string $dataClass
* @param array $validationGroups
* @param string $shippingMethodTranslationType
* @param ServiceRegistryInterface $calculatorRegistry
* @param ServiceRegistryInterface $checkerRegistry
* @param FormTypeRegistryInterface $formTypeRegistry
* @param EventSubscriberInterface $buildShippingMethodFormSubscriber
*/
public function __construct($dataClass, array $validationGroups, $shippingMethodTranslationType, ServiceRegistryInterface $calculatorRegistry, ServiceRegistryInterface $checkerRegistry, FormTypeRegistryInterface $formTypeRegistry, EventSubscriberInterface $buildShippingMethodFormSubscriber)
{
parent::__construct($dataClass, $validationGroups);
$this->shippingMethodTranslationType = $shippingMethodTranslationType;
$this->calculatorRegistry = $calculatorRegistry;
$this->checkerRegistry = $checkerRegistry;
$this->formTypeRegistry = $formTypeRegistry;
$this->buildShippingMethodFormSubscriber = $buildShippingMethodFormSubscriber;
}
示例5: configureOptions
/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);
$resolver->setDefaults(array('validation_groups' => function (Options $options) {
if ($options['shippable']) {
$this->validationGroups[] = 'shippable';
}
return $this->validationGroups;
}, 'shippable' => false))->setAllowedTypes('shippable', 'bool');
}
示例6: setDefaultOptions
/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
parent::setDefaultOptions($resolver);
$validationGroups = $this->validationGroups;
$resolver->setDefaults(array('validation_groups' => function (Options $options) use($validationGroups) {
if ($options['shippable']) {
$validationGroups[] = 'shippable';
}
return $validationGroups;
}, 'shippable' => false))->setAllowedTypes(array('shippable' => 'bool'));
}
示例7:
/**
* @param string $dataClass
* @param array $validationGroups
* @param string $subject
*/
function __construct($dataClass, array $validationGroups, $subject)
{
parent::__construct($dataClass, $validationGroups);
$this->subject = $subject;
}
示例8: configureOptions
/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);
$resolver->setDefault('rounding_mode', NumberToLocalizedStringTransformer::ROUND_HALF_EVEN);
}
示例9: configureOptions
/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);
$resolver->setDefaults(array('customer' => null, 'cascade_validation' => true));
}
示例10: configureOptions
/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);
$resolver->setDefined(['product'])->setAllowedTypes('product', ProductInterface::class);
}
示例11: configureOptions
/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);
$resolver->setDefaults(['customer' => null]);
}
示例12: __construct
/**
* @param string $dataClass
* @param array $validationGroups
* @param RepositoryInterface $customerRepository
*/
public function __construct($dataClass, array $validationGroups, RepositoryInterface $customerRepository)
{
parent::__construct($dataClass, $validationGroups);
$this->customerRepository = $customerRepository;
}
示例13: __construct
/**
* @param string $dataClass
* @param array $validationGroups
* @param MetadataInterface $metadata
*/
public function __construct($dataClass, array $validationGroups = [], MetadataInterface $metadata)
{
parent::__construct($dataClass, $validationGroups);
$this->metadata = $metadata;
}
示例14: setDefaultOptions
/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array('cascade_validation' => true));
parent::setDefaultOptions($resolver);
}
示例15: setDefaultOptions
/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
parent::setDefaultOptions($resolver);
$resolver->setOptional(array('criteria'))->setAllowedTypes(array('criteria' => array('array')));
}