本文整理汇总了PHP中Symfony\Component\OptionsResolver\OptionsResolverInterface::setRequired方法的典型用法代码示例。如果您正苦于以下问题:PHP OptionsResolverInterface::setRequired方法的具体用法?PHP OptionsResolverInterface::setRequired怎么用?PHP OptionsResolverInterface::setRequired使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\OptionsResolver\OptionsResolverInterface
的用法示例。
在下文中一共展示了OptionsResolverInterface::setRequired方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setDefaultOptions
/**
* @param OptionsResolverInterface $resolver
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array('data_class' => 'ArtesanIO\\MoocsyBundle\\Entity\\QuizDetailsUser'));
$resolver->setRequired(['question_label']);
$resolver->setRequired(['question_id']);
$resolver->setAllowedTypes(['question_label' => 'string', 'question_id' => 'int']);
}
示例2: setDefaultOptions
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setRequired(array('entityName'));
$resolver->setRequired(array('route'));
$resolver->setOptional(array('autosuggestMethod', 'valueMethod', 'route_parameters'));
$resolver->setDefaults(array('invalid_message' => 'Entity does not exists', 'autosuggestMethod' => 'autocomplete', 'valueMethod' => 'id', 'route_parameters' => array()));
}
示例3: setDefaultOptions
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setRequired(['praticiensChoices']);
$resolver->setDefaults(['praticiensChoices' => array()]);
$resolver->setRequired(['motifChoices']);
$resolver->setDefaults(['motifChoices' => array()]);
$resolver->setRequired(['echantillonChoices']);
$resolver->setDefaults(['echantillonChoices' => array()]);
}
示例4: setDefaultOptions
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setDefaults(array('label' => false, "container" => null, "field" => null));
$resolver->setRequired("resource");
$resolver->setRequired("area");
$resolver->setRequired("category");
$resolver->setAllowedTypes('resource', 'Bigfish\\Bundle\\ResourceBundle\\Entity\\Resource');
$resolver->setAllowedTypes('area', 'Bigfish\\Bundle\\PagekitBundle\\Entity\\Area');
$resolver->setAllowedTypes('category', 'Bigfish\\Bundle\\EavBundle\\Entity\\Category');
}
示例5: __construct
/**
* Instanciate the base filter
*
* @param AttributeValidatorHelper $attrValidatorHelper
* @param ConfigurationRegistryInterface $registry
* @param ReferenceDataIdResolver $idsResolver
* @param array $supportedOperators
*/
public function __construct(AttributeValidatorHelper $attrValidatorHelper, ConfigurationRegistryInterface $registry, ReferenceDataIdResolver $idsResolver, array $supportedOperators = [])
{
$this->attrValidatorHelper = $attrValidatorHelper;
$this->registry = $registry;
$this->idsResolver = $idsResolver;
$this->supportedOperators = $supportedOperators;
$this->optionsResolver = new OptionsResolver();
$this->optionsResolver->setRequired(['field']);
$this->optionsResolver->setOptional(['locale', 'scope']);
}
示例6: configureAttributes
/**
* {@inheritdoc}
*/
public function configureAttributes(OptionsResolverInterface $resolver)
{
$resolver->setRequired(['name', 'label']);
$resolver->setOptional(['comment', 'comment', 'repeat_min', 'repeat_max', 'limit', 'error', 'rules', 'filters', 'dependencies', 'main_id', 'visibility_change', 'upload_url', 'session_name', 'session_id', 'file_types', 'file_types_description', 'delete_handler', 'load_handler', 'property_path', 'dependencies', 'filters', 'rules']);
$resolver->setDefaults(['repeat_min' => 0, 'repeat_max' => ElementInterface::INFINITE, 'limit' => 1000, 'session_name' => session_name(), 'session_id' => session_id(), 'file_types_description' => 'file_types_description', 'file_types' => ['jpg', 'jpeg', 'png', 'gif'], 'property_path' => null, 'dependencies' => [], 'filters' => [], 'rules' => []]);
$resolver->setAllowedTypes(['file_types_description' => 'string', 'file_types' => 'array']);
}
示例7: configureOptions
/**
* Configures admin menu item options
*
* @param OptionsResolverInterface $resolver
*/
public function configureOptions(OptionsResolverInterface $resolver)
{
$resolver->setRequired(['id', 'name', 'link', 'path']);
$resolver->setOptional(['class', 'sort_order']);
$resolver->setDefaults(array('sort_order' => 0, 'class' => '', 'link' => ''));
$resolver->setAllowedTypes(array('id' => 'string', 'name' => 'string', 'link' => 'string', 'class' => 'string', 'sort_order' => 'integer'));
}
示例8: configureAttributes
/**
* {@inheritdoc}
*/
public function configureAttributes(OptionsResolverInterface $resolver)
{
$resolver->setRequired(['name', 'label']);
$resolver->setOptional(['options', 'comment', 'suffix', 'prefix', 'error', 'selector', 'css_attribute', 'addable', 'onAdd', 'add_item_prompt', 'default', 'property_path', 'dependencies', 'filters', 'rules', 'transformer']);
$resolver->setDefaults(['options' => [], 'dependencies' => [], 'filters' => [], 'rules' => [], 'property_path' => null, 'transformer' => null]);
$resolver->setAllowedTypes(['name' => 'string', 'label' => 'string', 'options' => 'array', 'comment' => 'string', 'suffix' => 'string', 'prefix' => 'string', 'error' => 'string', 'selector' => 'string', 'css_attribute' => 'string', 'addable' => 'bool', 'onAdd' => 'string', 'add_item_prompt' => 'string', 'default' => ['string', 'integer'], 'rules' => 'array', 'dependencies' => 'array', 'property_path' => ['null', 'object'], 'transformer' => ['null', 'object']]);
}
示例9: setDefaultOptions
/**
* Sets the configuration for the options resolver
* @param OptionsResolverInterface $resolver
*/
protected function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setRequired(array('file', 'document_columns', 'category_column'));
$resolver->setOptional(array('limit', 'delimiter', 'enclosure', 'escape', 'category_modifier'));
$resolver->setDefaults(array('limit' => false, 'length' => 0, 'delimiter' => ',', 'enclosure' => '"', 'escape' => '\\', 'category_modifier' => false));
$resolver->setAllowedTypes(array('file' => 'string', 'document_columns' => 'array', 'category_column' => 'string', 'length' => 'int', 'delimiter' => 'string', 'enclosure' => 'string', 'escape' => 'string'));
}
示例10: setDefaultOptions
/**
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setRequired(['type']);
$resolver->setDefaults(['data_class' => null, 'options' => [], 'fallback_type' => FallbackPropertyType::NAME, 'enabled_fallbacks' => [], 'extend_value_type' => 'hidden', 'default_callback' => function (FallbackType $fallbackType) {
return [self::FALLBACK_VALUE => $fallbackType];
}]);
}
示例11: configureOptions
/**
* {@inheritdoc}
*/
public function configureOptions(OptionsResolverInterface $resolver)
{
$resolver->setRequired(['rows_per_page', 'key']);
$resolver->setOptional(['default_sorting', 'right_click_menu', 'auto_suggest_delay', 'auto_suggest_min_length', 'auto_suggest_suggestions', 'only_one_selected', 'no_column_modification', 'no_column_resizing', 'create_input', 'save_column_modification', 'persistent']);
$resolver->setDefaults(['rows_per_page' => 50, 'key' => 'id']);
$resolver->setAllowedTypes(['rows_per_page' => 'int', 'key' => ['int', 'string'], 'default_sorting' => ['int', 'string'], 'right_click_menu' => 'bool', 'auto_suggest_delay' => 'int', 'auto_suggest_min_length' => 'int', 'auto_suggest_suggestions' => 'int', 'only_one_selected' => 'bool', 'no_column_modification' => 'bool', 'no_column_resizing' => 'bool', 'create_input' => 'bool', 'save_column_modification' => 'bool', 'persistent' => 'bool']);
}
示例12: configureAttributes
/**
* {@inheritdoc}
*/
public function configureAttributes(OptionsResolverInterface $resolver)
{
$resolver->setRequired(['text']);
$resolver->setOptional(['class', 'name']);
$resolver->setDefaults(['name' => '']);
$resolver->setAllowedTypes(['text' => 'string', 'class' => 'string']);
}
示例13: setDefaultOptions
/**
* Sets the configuration for the options resolver
* @param OptionsResolverInterface $resolver
*/
protected function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setRequired(array('directory'));
$resolver->setDefaults(array('mode' => self::MODE_DIRECTORY_AS_CATEGORY, 'include' => array(), 'limit' => null));
$resolver->setAllowedValues(array('mode' => array(self::MODE_DOCUMENT_AS_CATEGORY, self::MODE_DIRECTORY_AS_CATEGORY)));
$resolver->setAllowedTypes(array('directory' => 'string', 'mode' => 'int', 'include' => 'array'));
}
示例14: setDefaultOptions
/**
* @param OptionsResolverInterface $resolver
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$resolver->setOptional(array('default', 'query_builder', 'choices'));
$resolver->setAllowedTypes(array('choices' => 'array'));
$resolver->setRequired(array('create_form_type', 'class', 'property'));
$resolver->setDefaults(array('multiple' => false, 'to_select_text' => 'Выбрать', 'to_new_text' => 'Создать'));
}
示例15: configureAttributes
/**
* Configures Form attributes
*
* @param OptionsResolverInterface $resolver
*/
public function configureAttributes(OptionsResolverInterface $resolver)
{
$resolver->setRequired(['name']);
$resolver->setOptional(['class', 'action', 'method', 'tabs', 'property_path', 'dependencies', 'property_path', 'dependencies', 'filters', 'rules']);
$resolver->setDefaults(['action' => '', 'class' => '', 'method' => self::FORM_METHOD, 'tabs' => self::TABS_VERTICAL, 'property_path' => null, 'dependencies' => [], 'filters' => [], 'rules' => []]);
$resolver->setAllowedTypes(['class' => 'string', 'action' => 'string', 'method' => 'string', 'tabs' => 'integer']);
}