RangeFloatItem.php in Range 8
File
src/Plugin/Field/FieldType/RangeFloatItem.php
View source
<?php
namespace Drupal\range\Plugin\Field\FieldType;
use Drupal\Core\Field\FieldStorageDefinitionInterface;
use Drupal\Core\Form\FormStateInterface;
class RangeFloatItem extends RangeItemBase {
public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
return static::propertyDefinitionsByType('float');
}
public function fieldSettingsForm(array $form, FormStateInterface $form_state) {
$element = parent::fieldSettingsForm($form, $form_state);
$element['min']['#step'] = $element['max']['#step'] = 'any';
return $element;
}
public static function getColumnSpecification(FieldStorageDefinitionInterface $field_definition) {
return [
'type' => 'float',
];
}
}