/**
  * {@inheritdoc}
  */
 public function setDefaultOptions(OptionsResolverInterface $resolver)
 {
     $resolver->setDefaults(array('required' => false, 'condition_operator' => FilterOperands::OPERATOR_EQUAL, 'compound' => function (Options $options) {
         return $options['condition_operator'] == FilterOperands::OPERAND_SELECTOR;
     }, 'number_options' => array('required' => false), 'choice_options' => array('choices' => FilterOperands::getNumberOperandsChoices(), 'required' => false, 'translation_domain' => 'LexikFormFilterBundle'), 'data_extraction_method' => function (Options $options) {
         return $options['compound'] ? 'text' : 'default';
     }))->setAllowedValues(array('data_extraction_method' => array('text', 'default'), 'condition_operator' => FilterOperands::getNumberOperands(true)));
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function configureOptions(OptionsResolver $resolver)
 {
     $resolver->setDefaults(array('required' => false, 'condition_pattern' => FilterOperands::STRING_EQUALS, 'compound' => function (Options $options) {
         return $options['condition_pattern'] == FilterOperands::OPERAND_SELECTOR;
     }, 'text_options' => array('required' => false, 'trim' => true), 'choice_options' => array('choices' => FilterOperands::getStringOperandsChoices(), 'required' => false, 'translation_domain' => 'LexikFormFilterBundle'), 'data_extraction_method' => function (Options $options) {
         return $options['compound'] ? 'text' : 'default';
     }))->setAllowedValues('data_extraction_method', array('text', 'default'))->setAllowedValues('condition_pattern', FilterOperands::getStringOperands(true));
 }