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

Public Member Functions | Private Attributes | List of all members
eZ\Publish\Core\Helper\FieldHelper Class Reference

## Public Member Functions
| __construct (TranslationHelper $translationHelper, ContentTypeService $contentTypeService, FieldTypeService $fieldTypeService)
| isFieldEmpty (Content $content, $fieldDefIdentifier, $forcedLanguage=null)
| Checks if provided field can be considered empty. More...
| getFieldDefinition (ContentInfo $contentInfo, $fieldDefIdentifier)
| Returns FieldDefinition object based on $contentInfo and $fieldDefIdentifier. More...

## Private Attributes
| $contentTypeService
| $fieldTypeService
| $translationHelper

## Detailed Description

Definition at line 14 of file FieldHelper.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\Helper\FieldHelper::__construct | ( | TranslationHelper | $translationHelper,
|  | ContentTypeService | $contentTypeService,
|  | FieldTypeService | $fieldTypeService
| ) |  |

Definition at line 25 of file FieldHelper.php.

References eZ\Publish\Core\Helper\FieldHelper\$contentTypeService, eZ\Publish\Core\Helper\FieldHelper\$fieldTypeService, and eZ\Publish\Core\Helper\FieldHelper\$translationHelper.

## Member Function Documentation

## ◆ getFieldDefinition()

eZ\Publish\Core\Helper\FieldHelper::getFieldDefinition | ( | ContentInfo | $contentInfo,
|  |  | $fieldDefIdentifier
| ) |  |

Returns FieldDefinition object based on $contentInfo and $fieldDefIdentifier.

Deprecated:
  If you have Content you can instead do: $content->getContentType()->getFieldDefinition($identifier)

Parameters

  ContentInfo | $contentInfo |
  string | $fieldDefIdentifier |

Returns
  \eZ\Publish\API\Repository\Values\ContentType\FieldDefinition

Definition at line 62 of file FieldHelper.php.

## ◆ isFieldEmpty()

eZ\Publish\Core\Helper\FieldHelper::isFieldEmpty | ( | Content | $content,
|  |  | $fieldDefIdentifier,
|  |  | $forcedLanguage = `null`
| ) |  |

Checks if provided field can be considered empty.

Parameters

  \eZ\Publish\API\Repository\Values\Content\Content | $content |
  string | $fieldDefIdentifier |
  null | $forcedLanguage |

Returns
  bool

Definition at line 41 of file FieldHelper.php.

References eZ\Publish\API\Repository\Values\Content\Content\getContentType().

## Member Data Documentation

## ◆ $contentTypeService

eZ\Publish\Core\Helper\FieldHelper::$contentTypeService
| private

Definition at line 17 of file FieldHelper.php.

Referenced by eZ\Publish\Core\Helper\FieldHelper\__construct().

## ◆ $fieldTypeService

eZ\Publish\Core\Helper\FieldHelper::$fieldTypeService
| private

Definition at line 20 of file FieldHelper.php.

Referenced by eZ\Publish\Core\Helper\FieldHelper\__construct().

## ◆ $translationHelper

eZ\Publish\Core\Helper\FieldHelper::$translationHelper
| private

Definition at line 23 of file FieldHelper.php.

Referenced by eZ\Publish\Core\Helper\FieldHelper\__construct().

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

- FieldHelper.php

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