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

Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper Class Reference

Mapper for Content Type Handler. More...

## Public Member Functions
| __construct (ConverterRegistry $converterRegistry, MaskGenerator $maskGenerator)
| Creates a new content type mapper. More...
| createGroupFromCreateStruct (GroupCreateStruct $struct)
| Creates a Group from its create struct. More...
| extractGroupsFromRows (array $rows)
| Extracts Group objects from the given $rows. More...
| extractTypesFromRows (array $rows, bool $keepTypeIdAsKey=false)
| Extracts types and related data from the given $rows. More...
| extractMultilingualData (array $fieldDefinitionRows)
| extractFieldFromRow (array $row, array $multilingualData=[])
| Creates a FieldDefinition from the data in $row. More...
| createTypeFromCreateStruct (CreateStruct $createStruct)
| Maps properties from $struct to $type. More...
| createCreateStructFromType (Type $type)
| Creates a create struct from an existing $type. More...
| createUpdateStructFromType (Type $type)
| Creates an update struct from an existing $type. More...
| toStorageFieldDefinition (FieldDefinition $fieldDef, StorageFieldDefinition $storageFieldDef)
| Maps $fieldDef to the legacy storage specific StorageFieldDefinition. More...
| toFieldDefinition (StorageFieldDefinition $storageFieldDef, FieldDefinition $fieldDef)
| Maps a FieldDefinition from the given $storageFieldDef. More...
| createTypeFromUpdateStruct (UpdateStruct $updateStruct)
| extractMultilingualDataFromRows (array $mlFieldDefinitionsRows)

## Protected Member Functions
| extractTypeFromRow (array $row)
| Creates a Type from the data in $row. More...
| extractStorageFieldFromRow (array $row, array $multilingualDataRow=[])
| Extracts a StorageFieldDefinition from $row. More...
| unserialize ($serialized, $default=[])
| Wrap unserialize to set default value in case of empty serialization. More...

## Protected Attributes
| $converterRegistry

## Private Attributes
| $maskGenerator

## Detailed Description

Mapper for Content Type Handler.

Performs mapping of Type objects.

Definition at line 25 of file Publish/Core/Persistence/Legacy/Content/Type/Mapper.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper::__construct | ( | ConverterRegistry | $converterRegistry,
|  | MaskGenerator | $maskGenerator
| ) |  |

Creates a new content type mapper.

Parameters

  \eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\ConverterRegistry | $converterRegistry |
  \eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator | $maskGenerator |

Definition at line 43 of file Publish/Core/Persistence/Legacy/Content/Type/Mapper.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper\$converterRegistry, and eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper\$maskGenerator.

## Member Function Documentation

## ◆ createCreateStructFromType()

eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper::createCreateStructFromType | ( | Type | $type | ) |

Creates a create struct from an existing $type.

Parameters

  \eZ\Publish\SPI\Persistence\Content\Type | $type |

Returns
  \eZ\Publish\SPI\Persistence\Content\Type\CreateStruct

Definition at line 358 of file Publish/Core/Persistence/Legacy/Content/Type/Mapper.php.

## ◆ createGroupFromCreateStruct()

eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper::createGroupFromCreateStruct | ( | GroupCreateStruct | $struct | ) |

Creates a Group from its create struct.

Parameters

  \eZ\Publish\SPI\Persistence\Content\Type\Group\CreateStruct | $struct |

Todo:
  $description is not supported by database, yet

Returns
  Group

Definition at line 58 of file Publish/Core/Persistence/Legacy/Content/Type/Mapper.php.

## ◆ createTypeFromCreateStruct()

eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper::createTypeFromCreateStruct | ( | CreateStruct | $createStruct | ) |

Maps properties from $struct to $type.

Parameters

  \eZ\Publish\SPI\Persistence\Content\Type\CreateStruct | $createStruct |

Returns
  \eZ\Publish\SPI\Persistence\Content\Type

Definition at line 324 of file Publish/Core/Persistence/Legacy/Content/Type/Mapper.php.

## ◆ createTypeFromUpdateStruct()

eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper::createTypeFromUpdateStruct | ( | UpdateStruct | $updateStruct | ) |

Parameters

  \eZ\Publish\SPI\Persistence\Content\Type\UpdateStruct | $updateStruct |

Returns
  \eZ\Publish\SPI\Persistence\Content\Type

Definition at line 481 of file Publish/Core/Persistence/Legacy/Content/Type/Mapper.php.

## ◆ createUpdateStructFromType()

eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper::createUpdateStructFromType | ( | Type | $type | ) |

Creates an update struct from an existing $type.

Parameters

  \eZ\Publish\SPI\Persistence\Content\Type | $type |

Returns
  \eZ\Publish\SPI\Persistence\Content\Type\UpdateStruct

Definition at line 391 of file Publish/Core/Persistence/Legacy/Content/Type/Mapper.php.

## ◆ extractFieldFromRow()

eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper::extractFieldFromRow | ( | array | $row,
|  | array | $multilingualData = `[]`
| ) |  |

Creates a FieldDefinition from the data in $row.

Parameters

  array | $row |
  array | $multilingualData |

Returns
  \eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition

Definition at line 214 of file Publish/Core/Persistence/Legacy/Content/Type/Mapper.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper\extractStorageFieldFromRow(), eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper\toFieldDefinition(), and eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper\unserialize().

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper\extractTypesFromRows().

## ◆ extractGroupsFromRows()

eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper::extractGroupsFromRows | ( | array | $rows | ) |

Extracts Group objects from the given $rows.

Parameters

  array | $rows |

Returns
  \eZ\Publish\SPI\Persistence\Content\Type\Group[]

Definition at line 82 of file Publish/Core/Persistence/Legacy/Content/Type/Mapper.php.

## ◆ extractMultilingualData()

eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper::extractMultilingualData | ( | array | $fieldDefinitionRows | ) |

Definition at line 150 of file Publish/Core/Persistence/Legacy/Content/Type/Mapper.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper\extractTypesFromRows().

## ◆ extractMultilingualDataFromRows()

eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper::extractMultilingualDataFromRows | ( | array | $mlFieldDefinitionsRows | ) |

Definition at line 503 of file Publish/Core/Persistence/Legacy/Content/Type/Mapper.php.

## ◆ extractStorageFieldFromRow()

eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper::extractStorageFieldFromRow | ( | array | $row,
|  | array | $multilingualDataRow = `[]`
| ) |  |
| protected

Extracts a StorageFieldDefinition from $row.

Parameters

  array | $row |
  array | $multilingualDataRow |

Returns
  \eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldDefinition

Definition at line 256 of file Publish/Core/Persistence/Legacy/Content/Type/Mapper.php.

References eZ\Publish\SPI\Persistence\Content\Type\$description, eZ\Publish\SPI\Persistence\Content\Type\$languageCodes, eZ\Publish\SPI\Persistence\Content\Type\$name, and eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper\unserialize().

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper\extractFieldFromRow().

## ◆ extractTypeFromRow()

eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper::extractTypeFromRow | ( | array | $row | ) |
| protected

Creates a Type from the data in $row.

Parameters

  array | $row |

Returns
  Type

Definition at line 170 of file Publish/Core/Persistence/Legacy/Content/Type/Mapper.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper\unserialize().

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper\extractTypesFromRows().

## ◆ extractTypesFromRows()

eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper::extractTypesFromRows | ( | array | $rows,
|  | bool | $keepTypeIdAsKey = `false`
| ) |  |

Extracts types and related data from the given $rows.

Parameters

  array | $rows |
  bool | $keepTypeIdAsKey |

Returns
  array(Type)

Definition at line 109 of file Publish/Core/Persistence/Legacy/Content/Type/Mapper.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper\extractFieldFromRow(), eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper\extractMultilingualData(), and eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper\extractTypeFromRow().

## ◆ toFieldDefinition()

eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper::toFieldDefinition | ( | StorageFieldDefinition | $storageFieldDef,
|  | FieldDefinition | $fieldDef
| ) |  |

Maps a FieldDefinition from the given $storageFieldDef.

Parameters

  \eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldDefinition | $storageFieldDef |
  \eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition | $fieldDef |

Definition at line 448 of file Publish/Core/Persistence/Legacy/Content/Type/Mapper.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper\extractFieldFromRow().

## ◆ toStorageFieldDefinition()

eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper::toStorageFieldDefinition | ( | FieldDefinition | $fieldDef,
|  | StorageFieldDefinition | $storageFieldDef
| ) |  |

Maps $fieldDef to the legacy storage specific StorageFieldDefinition.

Parameters

  \eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition | $fieldDef |
  \eZ\Publish\Core\Persistence\Legacy\Content\StorageFieldDefinition | $storageFieldDef |

Definition at line 418 of file Publish/Core/Persistence/Legacy/Content/Type/Mapper.php.

## ◆ unserialize()

eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper::unserialize | ( |  | $serialized,
|  |  | $default = `[]`
| ) |  |
| protected

Wrap unserialize to set default value in case of empty serialization.

Parameters

  string | $serialized | Serialized structure to process
  mixed | $default | Default value in case of empty serialization

Returns
  array|mixed

Definition at line 469 of file Publish/Core/Persistence/Legacy/Content/Type/Mapper.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper\extractFieldFromRow(), eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper\extractStorageFieldFromRow(), and eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper\extractTypeFromRow().

## Member Data Documentation

## ◆ $converterRegistry

eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper::$converterRegistry
| protected

Definition at line 32 of file Publish/Core/Persistence/Legacy/Content/Type/Mapper.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper\__construct().

## ◆ $maskGenerator

eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper::$maskGenerator
| private

Definition at line 35 of file Publish/Core/Persistence/Legacy/Content/Type/Mapper.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\Mapper\__construct().

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

- Publish/Core/Persistence/Legacy/Content/Type/Mapper.php

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