function ContentTranslationHandler::checkFieldStorageDefinitionTranslatability

Same name in other branches
  1. 8.9.x core/modules/content_translation/src/ContentTranslationHandler.php \Drupal\content_translation\ContentTranslationHandler::checkFieldStorageDefinitionTranslatability()
  2. 10 core/modules/content_translation/src/ContentTranslationHandler.php \Drupal\content_translation\ContentTranslationHandler::checkFieldStorageDefinitionTranslatability()
  3. 11.x core/modules/content_translation/src/ContentTranslationHandler.php \Drupal\content_translation\ContentTranslationHandler::checkFieldStorageDefinitionTranslatability()

Checks the field storage definition for translatability support.

Checks whether the given field is defined in the field storage definitions and if its definition specifies it as translatable.

Parameters

string $field_name: The name of the field.

Return value

bool TRUE if translatable field storage definition exists, FALSE otherwise.

4 calls to ContentTranslationHandler::checkFieldStorageDefinitionTranslatability()
ContentTranslationHandler::hasAuthor in core/modules/content_translation/src/ContentTranslationHandler.php
Checks whether the entity type supports author natively.
ContentTranslationHandler::hasChangedTime in core/modules/content_translation/src/ContentTranslationHandler.php
Checks whether the entity type supports modification time natively.
ContentTranslationHandler::hasCreatedTime in core/modules/content_translation/src/ContentTranslationHandler.php
Checks whether the entity type supports creation time natively.
ContentTranslationHandler::hasPublishedStatus in core/modules/content_translation/src/ContentTranslationHandler.php
Checks whether the entity type supports published status natively.

File

core/modules/content_translation/src/ContentTranslationHandler.php, line 269

Class

ContentTranslationHandler
Base class for content translation handlers.

Namespace

Drupal\content_translation

Code

protected function checkFieldStorageDefinitionTranslatability($field_name) {
    return array_key_exists($field_name, $this->fieldStorageDefinitions) && $this->fieldStorageDefinitions[$field_name]
        ->isTranslatable();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.