/** * {@inheritdoc} */ public function getMetadata() { $metadata = parent::getMetadata(); $formView = $this->getForm()->createView(); $metadata['currencies'] = $formView->vars['currency_choices']; return $metadata; }
/** * {@inheritdoc} */ public function getMetadata() { $attribute = $this->getAttribute(); $metadata = parent::getMetadata(); if (true === $attribute->isDecimalsAllowed()) { $metadata['formatterOptions']['decimals'] = 2; $metadata['formatterOptions']['grouping'] = true; } return $metadata; }
/** * {@inheritdoc} */ public function getMetadata() { $metadata = parent::getMetadata(); $metadata['units'] = $this->measureManager->getUnitSymbolsForFamily($this->family); return $metadata; }
/** * {@inheritdoc} */ public function getMetadata() { $metadata = parent::getMetadata(); $metadata['unitChoices'] = []; $unitChoices = $this->getForm()->createView()['unit']->vars['choices']; foreach ($unitChoices as $choice) { $metadata['unitChoices'][] = ['data' => $choice->data, 'value' => $choice->value, 'label' => $choice->label, 'shortLabel' => $this->formatter->format($choice->value, true)]; } return $metadata; }