本文整理匯總了PHP中Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType::setDefaultOptions方法的典型用法代碼示例。如果您正苦於以下問題:PHP AbstractResourceType::setDefaultOptions方法的具體用法?PHP AbstractResourceType::setDefaultOptions怎麽用?PHP AbstractResourceType::setDefaultOptions使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType
的用法示例。
在下文中一共展示了AbstractResourceType::setDefaultOptions方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: 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());
}));
}
示例2: 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'));
}
示例3: setDefaultOptions
/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
parent::setDefaultOptions($resolver);
$resolver->setDefaults(array('master' => false));
}
示例4: setDefaultOptions
/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
parent::setDefaultOptions($resolver);
$resolver->setOptional(array('criteria'))->setAllowedTypes(array('criteria' => array('array')));
}
示例5: setDefaultOptions
/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array('cascade_validation' => true));
parent::setDefaultOptions($resolver);
}
示例6: setDefaultOptions
/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
parent::setDefaultOptions($resolver);
$resolver->setDefaults(array('user' => null));
}
示例7: setDefaultOptions
/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
parent::setDefaultOptions($resolver);
$resolver->setOptional(array('configuration_type'));
}