示例#1
0
 /**
  * {@inheritdoc}
  */
 public function getMetadata()
 {
     $metadata = parent::getMetadata();
     $metadata[FilterUtility::TYPE_KEY] = 'choice-tree';
     $metadata['data'] = $this->params['options']['data'];
     return $metadata;
 }
示例#2
0
 /**
  * {@inheritdoc}
  */
 public function getMetadata()
 {
     $metadata = parent::getMetadata();
     $formView = $this->getForm()->createView();
     $metadata['formatterOptions'] = $formView->vars['formatter_options'];
     return $metadata;
 }
 /**
  * {@inheritdoc}
  */
 public function getMetadata()
 {
     $metadata = parent::getMetadata();
     $formBuilder = $this->getFormBuilder();
     $dataType = $formBuilder->getOption('data_type');
     $metadata['formatterOptions'] = $this->getFormatterOptions($dataType);
     return $metadata;
 }
 /**
  * @return array
  */
 public function getMetadata()
 {
     $metadata = parent::getMetadata();
     if (isset($this->params['options']['class'])) {
         $metadata['class'] = $this->params['options']['class'];
     }
     return $metadata;
 }
示例#5
0
 /**
  * {@inheritdoc}
  */
 public function getMetadata()
 {
     $formView = $this->getForm()->createView();
     $fieldView = $formView->children['value'];
     $choices = array_map(function (ChoiceView $choice) {
         return ['label' => $choice->label, 'value' => $choice->value];
     }, $fieldView->vars['choices']);
     $metadata = parent::getMetadata();
     $metadata['choices'] = $choices;
     return $metadata;
 }
示例#6
0
 /**
  * {@inheritdoc}
  */
 public function getMetadata()
 {
     $formView = $this->getForm()->createView();
     $fieldView = $formView->children['value'];
     $choices = array_map(function (ChoiceView $choice) {
         return ['label' => $choice->label, 'value' => $choice->value];
     }, $fieldView->vars['choices']);
     $metadata = parent::getMetadata();
     $metadata['choices'] = $choices;
     if (!empty($metadata['placeholder'])) {
         $metadata['placeholder'] = $this->translator->trans($metadata['placeholder']);
     }
     return $metadata;
 }
 /**
  * {@inheritdoc}
  */
 public function getMetadata()
 {
     $formView = $this->getForm()->createView();
     $fieldView = $formView->children['value'];
     $choices = array_map(function (ChoiceView $choice) {
         return ['label' => $choice->label, 'value' => $choice->value];
     }, $fieldView->vars['choices']);
     $metadata = parent::getMetadata();
     $metadata['choices'] = $choices;
     $metadata['populateDefault'] = $formView->vars['populate_default'];
     if ($fieldView->vars['multiple']) {
         $metadata[FilterUtility::TYPE_KEY] = 'multichoice';
     }
     return $metadata;
 }
 /**
  * {@inheritdoc}
  */
 public function getMetadata()
 {
     $formView = $this->getForm()->createView();
     $fieldView = $formView->children['value'];
     $choices = array_map(function ($choice) {
         if ($choice instanceof ChoiceView) {
             return ['label' => $choice->label, 'value' => $choice->value];
         }
         if ($choice instanceof ChoiceGroupView) {
             return ['label' => $choice->label, 'value' => $choice->choices];
         }
         throw new \RuntimeException(sprintf('Invalid type of option for Choicefilter, expected ChoiceView or ChoiceGroupView, got "%s"', get_class($choice)));
     }, $fieldView->vars['choices']);
     $metadata = parent::getMetadata();
     $metadata['choices'] = $choices;
     $metadata['populateDefault'] = $formView->vars['populate_default'];
     if ($fieldView->vars['multiple']) {
         $metadata[FilterUtility::TYPE_KEY] = 'multichoice';
     }
     return $metadata;
 }
示例#9
0
 /**
  * {@inheritDoc}
  */
 public function init($name, array $params)
 {
     $params[FilterUtility::FRONTEND_TYPE_KEY] = 'segment';
     AbstractFilter::init($name, $params);
 }
 /**
  * {@inheritdoc}
  */
 public function getMetadata()
 {
     $formView = $this->getForm()->createView();
     $metadata = parent::getMetadata();
     $metadata['typeValues'] = $formView->vars['type_values'];
     $metadata['externalWidgetOptions'] = $formView->vars['widget_options'];
     return $metadata;
 }
示例#11
0
 /**
  * {@inheritdoc}
  */
 public function getMetadata()
 {
     $formView = $this->getForm()->createView();
     $metadata = parent::getMetadata();
     $metadata['typeValues'] = $formView->vars['type_values'];
     $metadata['dateParts'] = $formView->vars['date_parts'];
     $metadata['externalWidgetOptions'] = array_merge($formView->vars['widget_options'], ['dateVars' => $formView->vars['date_vars']]);
     return $metadata;
 }