General

  eZ Systems Website
  Technical documentation
  Editor documentation

This Documentation contains:
 
Technical documentation:



⚠ WARNING ! This documentation is deprecated !

Please go to the current Technical Documentation

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This field type Field Type represents a float value.

...

Table of Contents
minLevel2

Description

This FieldType Field Type stores numeric values which will be provided as floats.

Input expectations 

The FieldType Field Type expects a number as input. Both decimal and integer numbers are accepted.

...

Code Block
languagephp
titleConstructor example
linenumberstrue
use eZ\Publish\Core\FieldType\Float\Type;

// Instantiates a Float Value object
$floatValue = new Type\Value( 284.773 );

Validation

This FieldType Field Type supports FloatValueValidator, defining maximal and minimal float value:

...

Code Block
languagephp
titleValidator configuration example in PHP
linenumberstrue
use eZ\Publish\Core\FieldType\Float\Type;
  
$contentTypeService = $repository->getContentTypeService();
$floatFieldCreateStruct = $contentTypeService->newFieldDefinitionCreateStruct( "float", "ezfloat" );
 
// Accept only numbers between 0.1 and 203.99
$floatFieldCreateStruct->validatorConfiguration = array(
    "FileSizeValidator" => array(	
		"minFloatValue" => 0.1,
		"maxFloatValue" => 203.99
    )
);

Settings

This FieldType Field Type does not support settings.

...