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 | Private Member Functions | List of all members
eZ\Publish\Core\FieldType\ISBN\Type Class Reference

The ISBN field type. More...

Inheritance diagram for eZ\Publish\Core\FieldType\ISBN\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...
| isEmptyValue (SPIValue $value)
| Returns if the given $value is considered empty by the field type. More...
| validate (FieldDefinition $fieldDefinition, SPIValue $fieldValue)
| Validates a field based on the validators in the field definition. More...
| fromHash ($hash)
| Converts an $hash to the Value defined 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...
| 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 | ISBN13_PREFIX_LENGTH = 3
const | ISBN13_CHECK_LENGTH = 1
const | ISBN13_LENGTH = 13
const | ISBN13_PREFIX_978 = '978'
const | ISBN13_PREFIX_979 = '979'

## 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

## Private Member Functions
| validateISBNChecksum ($isbnNr)
| Validates the ISBN number. More...
| validateISBN13Checksum ($isbnNr, &$error)
| Validates the ISBN-13 number. More...

## 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

The ISBN field type.

This field type represents a simple string.

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

## Member Function Documentation

## ◆ checkValueStructure()

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

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

Exceptions

Definition at line 107 of file Core/FieldType/ISBN/Type.php.

## ◆ createValueFromInput()

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

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

Parameters

  string | \eZ\Publish\Core\FieldType\ISBN\Value | $inputValue |

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

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

Definition at line 91 of file Core/FieldType/ISBN/Type.php.

References eZ\Publish\Core\FieldType\ISBN\Type\fromHash().

## ◆ fromHash()

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

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

Parameters

  mixed | $hash |

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

Implements eZ\Publish\SPI\FieldType\FieldType.

Definition at line 193 of file Core/FieldType/ISBN/Type.php.

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

Referenced by eZ\Publish\Core\FieldType\ISBN\Type\createValueFromInput().

## ◆ getEmptyValue()

eZ\Publish\Core\FieldType\ISBN\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\ISBN\Value

Implements eZ\Publish\SPI\FieldType\FieldType.

Definition at line 67 of file Core/FieldType/ISBN/Type.php.

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

## ◆ getFieldTypeIdentifier()

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

Returns the field type identifier for this field type.

Returns
  string

Implements eZ\Publish\SPI\FieldType\FieldType.

Definition at line 41 of file Core/FieldType/ISBN/Type.php.

## ◆ getName()

eZ\Publish\Core\FieldType\ISBN\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\ISBN\Value | $value |

Returns
  string

Definition at line 56 of file Core/FieldType/ISBN/Type.php.

## ◆ getSortInfo()

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

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

Parameters

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

Returns
  string

Definition at line 181 of file Core/FieldType/ISBN/Type.php.

## ◆ isEmptyValue()

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

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

Parameters

  mixed | $value |

Returns
  bool

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

Definition at line 79 of file Core/FieldType/ISBN/Type.php.

Referenced by eZ\Publish\Core\FieldType\ISBN\Type\toHash(), and eZ\Publish\Core\FieldType\ISBN\Type\validate().

## ◆ isSearchable()

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

Returns whether the field type is searchable.

Returns
  bool

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

Definition at line 223 of file Core/FieldType/ISBN/Type.php.

## ◆ toHash()

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

Converts a $Value to a hash.

Parameters

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

Returns
  mixed

Definition at line 209 of file Core/FieldType/ISBN/Type.php.

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

## ◆ validate()

eZ\Publish\Core\FieldType\ISBN\Type::validate | ( | FieldDefinition | $fieldDefinition,
|  | SPIValue | $fieldValue
| ) |  |

Validates a field based on the validators in the field definition.

Does not use validators.

Exceptions

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

Definition at line 130 of file Core/FieldType/ISBN/Type.php.

References eZ\Publish\API\Repository\Values\ContentType\FieldDefinition\getFieldSettings(), eZ\Publish\Core\FieldType\ISBN\Type\isEmptyValue(), eZ\Publish\Core\FieldType\ISBN\Type\validateISBN13Checksum(), and eZ\Publish\Core\FieldType\ISBN\Type\validateISBNChecksum().

## ◆ validateFieldSettings()

eZ\Publish\Core\FieldType\ISBN\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 235 of file Core/FieldType/ISBN/Type.php.

## ◆ validateISBN13Checksum()

eZ\Publish\Core\FieldType\ISBN\Type::validateISBN13Checksum | ( |  | $isbnNr,
|  | & | $error
| ) |  |
| private

Validates the ISBN-13 number.

Parameters

  string | $isbnNr | A string containing the number without any dashes.
  string | $error | is used to send back an error message that will be shown to the user if the ISBN number validated.

Returns
  bool

Definition at line 308 of file Core/FieldType/ISBN/Type.php.

References eZ\Publish\Core\FieldType\ISBN\Type\ISBN13_LENGTH.

Referenced by eZ\Publish\Core\FieldType\ISBN\Type\validate().

## ◆ validateISBNChecksum()

eZ\Publish\Core\FieldType\ISBN\Type::validateISBNChecksum | ( |  | $isbnNr | ) |
| private

Validates the ISBN number.

All characters should be numeric except the last digit that may be the character X, which should be calculated as 10.

Parameters

  string | $isbnNr | A string containing the number without any dashes.

Returns
  bool

Definition at line 280 of file Core/FieldType/ISBN/Type.php.

Referenced by eZ\Publish\Core\FieldType\ISBN\Type\validate().

## Member Data Documentation

## ◆ $settingsSchema

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

Initial value:
= [
'isISBN13' => [
'type' => 'boolean',
'default' => true,
],
]

Definition at line 29 of file Core/FieldType/ISBN/Type.php.

## ◆ ISBN13_CHECK_LENGTH

const eZ\Publish\Core\FieldType\ISBN\Type::ISBN13_CHECK_LENGTH = 1

Definition at line 24 of file Core/FieldType/ISBN/Type.php.

## ◆ ISBN13_LENGTH

const eZ\Publish\Core\FieldType\ISBN\Type::ISBN13_LENGTH = 13

Definition at line 25 of file Core/FieldType/ISBN/Type.php.

Referenced by eZ\Publish\Core\FieldType\ISBN\Type\validateISBN13Checksum().

## ◆ ISBN13_PREFIX_978

const eZ\Publish\Core\FieldType\ISBN\Type::ISBN13_PREFIX_978 = '978'

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

## ◆ ISBN13_PREFIX_979

const eZ\Publish\Core\FieldType\ISBN\Type::ISBN13_PREFIX_979 = '979'

Definition at line 27 of file Core/FieldType/ISBN/Type.php.

## ◆ ISBN13_PREFIX_LENGTH

const eZ\Publish\Core\FieldType\ISBN\Type::ISBN13_PREFIX_LENGTH = 3

Definition at line 23 of file Core/FieldType/ISBN/Type.php.

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

- Core/FieldType/ISBN/Type.php

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