Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
eZ\Publish\Core\FieldType\Time\Type Class Reference
Inheritance diagram for eZ\Publish\Core\FieldType\Time\Type:

## Public Member Functions
| getFieldTypeIdentifier ()
| Returns the field type identifier for this field type. More...
| getName (SPIValue $value)
| Returns the name of the given field value. More...
| getEmptyValue ()
| Returns the fallback default value of field type when no such default value is provided in the field definition in content types. More...
| fromHash ($hash)
| Converts an $hash to the Value defined by the field type. More...
| isEmptyValue (SPIValue $value)
| Returns if the given $value is considered empty by the field type. More...
| toHash (SPIValue $value)
| Converts a $Value to a hash. More...
| isSearchable ()
| Returns whether the field type is searchable. More...
| validateFieldSettings ($fieldSettings)
| Validates the fieldSettings of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct. More...
Public Member Functions inherited from eZ\Publish\Core\FieldType\FieldType
| setTransformationProcessor (TransformationProcessor $transformationProcessor)
| getSettingsSchema ()
| Returns a schema for the settings expected by the FieldType. More...
| getValidatorConfigurationSchema ()
| Returns a schema for the validator configuration expected by the FieldType. More...
| validate (FieldDefinition $fieldDefinition, SPIValue $value)
| Validates a field based on the validators in the field definition. More...
| validateValidatorConfiguration ($validatorConfiguration)
| Validates the validatorConfiguration of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct. More...
| applyDefaultValidatorConfiguration (&$validatorConfiguration)
| Applies the default values to the given $validatorConfiguration of a FieldDefinitionCreateStruct. More...
| applyDefaultSettings (&$fieldSettings)
| Applies the default values to the fieldSettings of a FieldDefinitionCreateStruct. More...
| toPersistenceValue (SPIValue $value)
| Converts a $value to a persistence value. More...
| fromPersistenceValue (PersistenceValue $fieldValue)
| Converts a persistence $fieldValue to a Value. More...
| isSingular ()
| Indicates if the field definition of this type can appear only once in the same ContentType. More...
| onlyEmptyInstance ()
| Indicates if the field definition of this type can be added to a ContentType with Content instances. More...
| acceptValue ($inputValue)
| Potentially builds and checks the type and structure of the $inputValue. More...
| fieldSettingsToHash ($fieldSettings)
| Converts the given $fieldSettings to a simple hash format. More...
| fieldSettingsFromHash ($fieldSettingsHash)
| Converts the given $fieldSettingsHash to field settings of the type. More...
| validatorConfigurationToHash ($validatorConfiguration)
| Converts the given $validatorConfiguration to a simple hash format. More...
| validatorConfigurationFromHash ($validatorConfigurationHash)
| Converts the given $validatorConfigurationHash to a validator configuration of the type. More...
| getRelations (SPIValue $fieldValue)
| Returns relation data extracted from value. More...
| valuesEqual (SPIValue $value1, SPIValue $value2)
Public Member Functions inherited from eZ\Publish\SPI\FieldType\FieldType
| getName (Value $value)
| Returns a human readable string representation from the given $value. More...
| validate (FieldDefinition $fieldDef, Value $value)
| Validates a field based on the validator configuration in the field definition. More...
| isEmptyValue (Value $value)
| Returns if the given $value is considered empty by the field type. More...
| toHash (Value $value)
| Converts the given $value into a plain hash format. More...
| toPersistenceValue (Value $value)
| Converts a $value to a persistence value. More...
| fromPersistenceValue (FieldValue $fieldValue)
| Converts a persistence $value to a Value. More...
| getRelations (Value $value)
| Returns relation data extracted from value. More...
Public Member Functions inherited from eZ\Publish\SPI\FieldType\Comparable
| valuesEqual (Value $value1, Value $value2)

## Public Attributes
const | DEFAULT_EMPTY = 0
| Default value type empty. More...
const | DEFAULT_CURRENT_TIME = 1
| Default value type current date. More...

## Protected Member Functions
| createValueFromInput ($inputValue)
| Inspects given $inputValue and potentially converts it into a dedicated value object. More...
| checkValueStructure (BaseValue $value)
| Throws an exception if value structure is not of expected format. More...
| getSortInfo (BaseValue $value)
| Returns information for FieldValue->$sortKey relevant to the field type. More...
Protected Member Functions inherited from eZ\Publish\Core\FieldType\FieldType
| getSortInfo (Value $value)
| Returns information for FieldValue->$sortKey relevant to the field type. More...
| checkValueStructure (Value $value)
| Throws an exception if value structure is not of expected format. More...

## Protected Attributes
| $settingsSchema
Protected Attributes inherited from eZ\Publish\Core\FieldType\FieldType
| $settingsSchema = []
| $validatorConfigurationSchema = []
| $transformationProcessor

## Additional Inherited Members
Static Protected Member Functions inherited from eZ\Publish\Core\FieldType\FieldType
static | checkValueType ($value)
| Throws an exception if the given $value is not an instance of the supported value subtype. More...

## Detailed Description

Definition at line 16 of file Core/FieldType/Time/Type.php.

## Member Function Documentation

## ◆ checkValueStructure()

eZ\Publish\Core\FieldType\Time\Type::checkValueStructure | ( | BaseValue | $value | ) |
| protected

Throws an exception if value structure is not of expected format.

Exceptions

Definition at line 113 of file Core/FieldType/Time/Type.php.

## ◆ createValueFromInput()

eZ\Publish\Core\FieldType\Time\Type::createValueFromInput | ( |  | $inputValue | ) |
| protected

Inspects given $inputValue and potentially converts it into a dedicated value object.

Parameters

  string | int | \DateTime | \eZ\Publish\Core\FieldType\Time\Value | $inputValue |

Returns
  \eZ\Publish\Core\FieldType\Time\Value The potentially converted and structurally plausible value.

Reimplemented from eZ\Publish\Core\FieldType\FieldType.

Definition at line 89 of file Core/FieldType/Time/Type.php.

## ◆ fromHash()

eZ\Publish\Core\FieldType\Time\Type::fromHash | ( |  | $hash | ) |

Converts an $hash to the Value defined by the field type.

Parameters

  int | $hash | Number of seconds since Unix Epoch

Returns
  \eZ\Publish\Core\FieldType\Time\Value $value

Implements eZ\Publish\SPI\FieldType\FieldType.

Definition at line 143 of file Core/FieldType/Time/Type.php.

References eZ\Publish\Core\FieldType\Time\Type\getEmptyValue().

## ◆ getEmptyValue()

eZ\Publish\Core\FieldType\Time\Type::getEmptyValue | ( |  | ) |

Returns the fallback default value of field type when no such default value is provided in the field definition in content types.

Returns
  \eZ\Publish\Core\FieldType\Time\Value

Implements eZ\Publish\SPI\FieldType\FieldType.

Definition at line 77 of file Core/FieldType/Time/Type.php.

Referenced by eZ\Publish\Core\FieldType\Time\Type\fromHash().

## ◆ getFieldTypeIdentifier()

eZ\Publish\Core\FieldType\Time\Type::getFieldTypeIdentifier | ( |  | ) |

Returns the field type identifier for this field type.

Returns
  string

Implements eZ\Publish\SPI\FieldType\FieldType.

Definition at line 45 of file Core/FieldType/Time/Type.php.

## ◆ getName()

eZ\Publish\Core\FieldType\Time\Type::getName | ( | SPIValue | $value | ) |

Returns the name of the given field value.

It will be used to generate content name and url alias if current field is designated to be used in the content name/urlAlias pattern.

Parameters

  \eZ\Publish\Core\FieldType\Time\Value | $value |

Returns
  string

Definition at line 60 of file Core/FieldType/Time/Type.php.

References eZ\Publish\Core\FieldType\Time\Type\isEmptyValue().

## ◆ getSortInfo()

eZ\Publish\Core\FieldType\Time\Type::getSortInfo | ( | BaseValue | $value | ) |
| protected

Returns information for FieldValue->$sortKey relevant to the field type.

Parameters

  \eZ\Publish\Core\FieldType\Time\Value | $value |

Returns
  int

Definition at line 131 of file Core/FieldType/Time/Type.php.

## ◆ isEmptyValue()

eZ\Publish\Core\FieldType\Time\Type::isEmptyValue | ( | SPIValue | $value | ) |

Returns if the given $value is considered empty by the field type.

Parameters

  \eZ\Publish\Core\FieldType\Value | $value |

Returns
  bool

Reimplemented from eZ\Publish\Core\FieldType\FieldType.

Definition at line 160 of file Core/FieldType/Time/Type.php.

Referenced by eZ\Publish\Core\FieldType\Time\Type\getName(), and eZ\Publish\Core\FieldType\Time\Type\toHash().

## ◆ isSearchable()

eZ\Publish\Core\FieldType\Time\Type::isSearchable | ( |  | ) |

Returns whether the field type is searchable.

Returns
  bool

Reimplemented from eZ\Publish\Core\FieldType\FieldType.

Definition at line 190 of file Core/FieldType/Time/Type.php.

## ◆ toHash()

eZ\Publish\Core\FieldType\Time\Type::toHash | ( | SPIValue | $value | ) |

Converts a $Value to a hash.

Parameters

  \eZ\Publish\Core\FieldType\Time\Value | $value |

Returns
  mixed

Definition at line 176 of file Core/FieldType/Time/Type.php.

References eZ\Publish\Core\FieldType\Time\Type\isEmptyValue().

## ◆ validateFieldSettings()

eZ\Publish\Core\FieldType\Time\Type::validateFieldSettings | ( |  | $fieldSettings | ) |

Validates the fieldSettings of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct.

Parameters

  mixed | $fieldSettings |

Returns
  \eZ\Publish\SPI\FieldType\ValidationError[]

Reimplemented from eZ\Publish\Core\FieldType\FieldType.

Definition at line 202 of file Core/FieldType/Time/Type.php.

References eZ\Publish\Core\FieldType\Time\Type\DEFAULT_CURRENT_TIME, and eZ\Publish\Core\FieldType\Time\Type\DEFAULT_EMPTY.

## Member Data Documentation

## ◆ $settingsSchema

eZ\Publish\Core\FieldType\Time\Type::$settingsSchema
| protected

Initial value:
= [
'useSeconds' => [
'type' => 'bool',
'default' => false,
],
'defaultType' => [
'type' => 'choice',
'default' => self::DEFAULT_EMPTY,
],
]
eZ\Publish\Core\FieldType\Time\Type\DEFAULT_EMPTY
const DEFAULT_EMPTY
Default value type empty.
Definition: Core/FieldType/Time/Type.php:21

Definition at line 28 of file Core/FieldType/Time/Type.php.

## ◆ DEFAULT_CURRENT_TIME

const eZ\Publish\Core\FieldType\Time\Type::DEFAULT_CURRENT_TIME = 1

Default value type current date.

Definition at line 26 of file Core/FieldType/Time/Type.php.

Referenced by eZ\Publish\Core\FieldType\Time\Type\validateFieldSettings().

## ◆ DEFAULT_EMPTY

const eZ\Publish\Core\FieldType\Time\Type::DEFAULT_EMPTY = 0

Default value type empty.

Definition at line 21 of file Core/FieldType/Time/Type.php.

Referenced by eZ\Publish\Core\FieldType\Time\Type\validateFieldSettings().

The documentation for this class was generated from the following file:

- Core/FieldType/Time/Type.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.