Integer Field Type: comparison of v.2 vs v.3
Versions Compared
Old Version 2
changes.mady.by.user Dominika Kurek
Saved on Apr 29, 2016
compared with
New Version 3
changes.mady.by.user Dominika Kurek
Saved on Oct 25, 2016
- Previous Change: Difference between versions 1 and 2
- Next Change: Difference between versions 3 and 4
- View Page History
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Comment: ref. EZP-26382
This Field Type represents an integer value.
| Name | Internal name | Expected input |
|---|---|---|
| Integer | ezinteger | integer |
Description
This Field Type stores numeric values which will be provided as integers.
Input expectations
| Type | Example |
|---|---|
| integer | 2397 |
Value object
Properties
The Value class of this field type contains the following properties:
| Property | Type | Description |
|---|---|---|
| $value | int | This property will be used to store the value provided as an integer. |
| Code Block | ||||||
|---|---|---|---|---|---|---|
|
||||||
$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 | ||||||
|---|---|---|---|---|---|---|
|
||||||
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:
| Name | Type | Default value | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| minIntegerValue | int | 0 | This setting defines the minimum value this FieldType will allow as input. | ||||||||
| maxIntegerValue | int | false /
|
This setting defines the maximum value this FieldType will allow as input. |
| Code Block | ||||||
|---|---|---|---|---|---|---|
|
||||||
$validatorConfiguration = array( "minIntegerValue" => 1, "maxIntegerValue" => 24 ); |
Settings
This Field Type does not support settings.
Comments
Add a comment