All other field types extend FieldType providing the specific functionality desired in each case. The capabilities supported by each individual field type is decided by which interfaces the field type implements support for. These individual capabilities can also be checked via the supports*() methods. Field types are the base building blocks of Content Types, and serve as data containers for Content objects. Therefore, while field types can be used independently, they are designed to be used as a part of a Content object. Field types are primed and pre-configured with the Field Definitions found in Content Types.
Inheritance: implements eZ\Publish\SPI\FieldType\FieldType
Beispiel #1
0
 /**
  * Converts the given $validatorConfigurationHash to a validator
  * configuration of the type
  *
  * @param array|hash|scalar|null $validatorConfigurationHash
  *
  * @return mixed
  */
 public function validatorConfigurationFromHash($validatorConfigurationHash)
 {
     return $this->internalFieldType->validatorConfigurationFromHash($validatorConfigurationHash);
 }
Beispiel #2
0
 /**
  * Validates a field value based on the validator configuration in the field definition.
  *
  * @param \eZ\Publish\API\Repository\Values\ContentType\FieldDefinition $fieldDef The field definition of the field
  * @param \eZ\Publish\SPI\FieldType\Value $value The field value for which an action is performed
  *
  * @return \eZ\Publish\SPI\FieldType\ValidationError[]
  */
 public function validateValue(APIFieldDefinition $fieldDef, Value $value)
 {
     return $this->internalFieldType->validate($fieldDef, $value);
 }
Beispiel #3
0
 /**
  * Converts the given $fieldSettingsHash to field settings of the type
  *
  * This is the reverse operation of {@link fieldSettingsToHash()}.
  *
  * This is the default implementation, which just returns the given
  * $fieldSettingsHash, assuming the supported field settings are already in
  * a hash format. Overwrite this in your specific implementation, if
  * necessary.
  *
  * @param array|hash|scalar|null $fieldSettingsHash
  *
  * @return mixed
  */
 public function fieldSettingsFromHash($fieldSettingsHash)
 {
     $fieldSettings = parent::fieldSettingsFromHash($fieldSettingsHash);
     if (isset($fieldSettings['dateInterval'])) {
         $fieldSettings['dateInterval'] = new \DateInterval($fieldSettings['dateInterval']);
     }
     return $fieldSettings;
 }