本文整理汇总了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'));
}