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

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

Action to add a field to content objects. More...

Inheritance diagram for eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action\AddField:

## Public Member Functions
| __construct (Gateway $contentGateway, FieldDefinition $fieldDef, Converter $converter, StorageHandler $storageHandler, ContentMapper $contentMapper)
| Creates a new action. More...
| apply ($contentId)
| Applies the action to the given $content. More...
Public Member Functions inherited from eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action
| __construct (ContentGateway $contentGateway)
| Creates a new action. More...

## Protected Member Functions
| insertField (Content $content, Field $field)
| Inserts given $field to the internal and external storage. More...
| createField ($id, $versionNo, $languageCode)
| Creates new Field value object, setting given parameters and default value for a field definition the action is constructed for. More...

## Protected Attributes
| $fieldDefinition
| $storageHandler
| $fieldValueConverter
| $contentMapper
Protected Attributes inherited from eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action
| $contentGateway

## Detailed Description

Action to add a field to content objects.

Definition at line 22 of file AddField.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action\AddField::__construct | ( | Gateway | $contentGateway,
|  | FieldDefinition | $fieldDef,
|  | Converter | $converter,
|  | StorageHandler | $storageHandler,
|  | ContentMapper | $contentMapper
| ) |  |

Creates a new action.

Parameters

  \eZ\Publish\Core\Persistence\Legacy\Content\Gateway | $contentGateway |
  \eZ\Publish\SPI\Persistence\Content\Type\FieldDefinition | $fieldDef |
  \eZ\Publish\Core\Persistence\Legacy\Content\FieldValue\Converter | $converter |
  \eZ\Publish\Core\Persistence\Legacy\Content\StorageHandler | $storageHandler |
  \eZ\Publish\Core\Persistence\Legacy\Content\Mapper | $contentMapper |

Definition at line 57 of file AddField.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action\$contentGateway, eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action\AddField\$contentMapper, and eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action\AddField\$storageHandler.

## Member Function Documentation

## ◆ apply()

eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action\AddField::apply | ( |  | $contentId | ) |

Applies the action to the given $content.

Parameters

  int | $contentId |

Reimplemented from eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action.

Definition at line 76 of file AddField.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action\AddField\createField(), and eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action\AddField\insertField().

## ◆ createField()

eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action\AddField::createField | ( |  | $id,
|  |  | $versionNo,
|  |  | $languageCode
| ) |  |
| protected

Creates new Field value object, setting given parameters and default value for a field definition the action is constructed for.

Parameters

  int | null | $id |
  int | $versionNo |
  string | $languageCode |

Returns
  \eZ\Publish\SPI\Persistence\Content\Field

Definition at line 191 of file AddField.php.

References eZ\Publish\SPI\Persistence\Content\Type\$id.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action\AddField\apply().

## ◆ insertField()

eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action\AddField::insertField | ( | Content | $content,
|  | Field | $field
| ) |  |
| protected

Inserts given $field to the internal and external storage.

If $field->id is null, creating new field id will be created. Otherwise it will be inserted for the given $content version, reusing existing Field id.

Parameters

  \eZ\Publish\SPI\Persistence\Content | $content |
  \eZ\Publish\SPI\Persistence\Content\Field | $field |

Returns
  int The ID of the field that was inserted

Definition at line 138 of file AddField.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action\AddField\apply().

## Member Data Documentation

## ◆ $contentMapper

eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action\AddField::$contentMapper
| protected

Definition at line 46 of file AddField.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action\AddField\__construct().

## ◆ $fieldDefinition

eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action\AddField::$fieldDefinition
| protected

Definition at line 29 of file AddField.php.

## ◆ $fieldValueConverter

eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action\AddField::$fieldValueConverter
| protected

Definition at line 43 of file AddField.php.

## ◆ $storageHandler

eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action\AddField::$storageHandler
| protected

Definition at line 36 of file AddField.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Type\ContentUpdater\Action\AddField\__construct().

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

- AddField.php

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