General

  eZ Systems Website
  Editor documentation


  Developer documentation

  Back to the top

Versions Compared

Key

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

This Field Type represents an integer value.

NameInternal nameExpected input
Integerezintegerinteger

Table of contents:

Table of Contents
minLevel2

Description

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

PHP API Field Type 

Input expectations

TypeExample
integer

2397

Value object

Properties

The Value class of this field type contains the following properties:

PropertyTypeDescription
$valueintThis property will be used to store the value provided as an integer.
Code Block
languagephp
titleValue object content example
linenumberstrue
$integer->value = 8
Constructor

The Integer\Value constructor will initialize a new Value object with the value provided. It expects a numeric, integer value.

Code Block
languagephp
titleConstructor example
linenumberstrue
use eZ\Publish\Core\FieldType\Integer;
 
// Instantiates a Integer Value object
$integerValue = new Integer\Value( 8 );

Hash format

Hash value of this Field Type is simply integer value as a string.

Example:

"8"

String representation

String representation of the Field Type's value will return the integer value as a string.

Example:

"8"

Validation

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

NameTypeDefault valueDescription
minIntegerValueint0This setting defines the minimum value this FieldType will allow as input.
maxIntegerValueintfalse /
Status
colourYellow
titlev1.5.2, v1.6.1
null
This setting defines the maximum value this FieldType will allow as input.
Code Block
languagephp
titleExample of validator configuration in PHP
linenumberstrue
$validatorConfiguration = array(
	"minIntegerValue" => 1,
	"maxIntegerValue" => 24
);

Settings

This Field Type does not support settings.