当前位置: 首页>>代码示例>>PHP>>正文


PHP OptionsResolverInterface::setRequired方法代码示例

本文整理汇总了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']);
 }
开发者ID:ArtesanIO,项目名称:MoocsyBundle,代码行数:10,代码来源:QuizDetailsUserType.php

示例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()));
 }
开发者ID:ioalessio,项目名称:autosuggestbundle,代码行数:7,代码来源:AutosuggestType.php

示例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()]);
 }
开发者ID:CorentinDodon,项目名称:GSB-PHP,代码行数:9,代码来源:SaisieType.php

示例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');
 }
开发者ID:bigfishcmf,项目名称:bigfishcmf,代码行数:10,代码来源:PagekitGridType.php

示例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']);
 }
开发者ID:jacko972,项目名称:pim-community-dev,代码行数:18,代码来源:ReferenceDataFilter.php

示例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']);
 }
开发者ID:jmarceli,项目名称:WellCommerce,代码行数:10,代码来源:Image.php

示例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'));
 }
开发者ID:jmarceli,项目名称:WellCommerce,代码行数:12,代码来源:AdminMenuItem.php

示例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']]);
 }
开发者ID:jmarceli,项目名称:WellCommerce,代码行数:10,代码来源:OptionedField.php

示例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'));
 }
开发者ID:camspiers,项目名称:statistical-classifier,代码行数:11,代码来源:CSV.php

示例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];
     }]);
 }
开发者ID:hafeez3000,项目名称:orocommerce,代码行数:10,代码来源:HiddenFallbackValueType.php

示例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']);
 }
开发者ID:jmarceli,项目名称:WellCommerce,代码行数:10,代码来源:Mechanics.php

示例12: configureAttributes

 /**
  * {@inheritdoc}
  */
 public function configureAttributes(OptionsResolverInterface $resolver)
 {
     $resolver->setRequired(['text']);
     $resolver->setOptional(['class', 'name']);
     $resolver->setDefaults(['name' => '']);
     $resolver->setAllowedTypes(['text' => 'string', 'class' => 'string']);
 }
开发者ID:jmarceli,项目名称:WellCommerce,代码行数:10,代码来源:StaticText.php

示例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'));
 }
开发者ID:camspiers,项目名称:statistical-classifier,代码行数:11,代码来源:Directory.php

示例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' => 'Создать'));
 }
开发者ID:amaxlab,项目名称:form-bundle,代码行数:10,代码来源:SelectOrAddType.php

示例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']);
 }
开发者ID:jmarceli,项目名称:WellCommerce,代码行数:12,代码来源:Form.php


注:本文中的Symfony\Component\OptionsResolver\OptionsResolverInterface::setRequired方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。