You are here

protected function DefaultContentEntityHandler::hasLabelProperty in CMS Content Sync 8

Same name and namespace in other branches
  1. 2.1.x src/Plugin/cms_content_sync/entity_handler/DefaultContentEntityHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\entity_handler\DefaultContentEntityHandler::hasLabelProperty()
  2. 2.0.x src/Plugin/cms_content_sync/entity_handler/DefaultContentEntityHandler.php \Drupal\cms_content_sync\Plugin\cms_content_sync\entity_handler\DefaultContentEntityHandler::hasLabelProperty()

Check whether the entity type supports having a label.

Return value

bool

Throws

\Drupal\Component\Plugin\Exception\PluginNotFoundException

Overrides EntityHandlerBase::hasLabelProperty

File

src/Plugin/cms_content_sync/entity_handler/DefaultContentEntityHandler.php, line 76

Class

DefaultContentEntityHandler
Class DefaultContentEntityHandler, providing a minimalistic implementation for any content entity type.

Namespace

Drupal\cms_content_sync\Plugin\cms_content_sync\entity_handler

Code

protected function hasLabelProperty() {
  $moduleHandler = \Drupal::service('module_handler');
  $eck_exists = $moduleHandler
    ->moduleExists('eck');
  if ($eck_exists) {
    $entity_type = \Drupal::entityTypeManager()
      ->getStorage('eck_entity_type')
      ->load($this->entityTypeName);
    if ($entity_type) {
      return $entity_type
        ->hasTitleField();
    }
  }
  return true;
}