You are here

public static function WebformContentCreatorUtilities::contentTypeFields in Webform Content Creator 3.x

Same name and namespace in other branches
  1. 8 src/WebformContentCreatorUtilities.php \Drupal\webform_content_creator\WebformContentCreatorUtilities::contentTypeFields()

Return the content type fields.

Parameters

Drupal\node\Entity\NodeType $content_type: Content type entity.

Return value

array Content type fields

5 calls to WebformContentCreatorUtilities::contentTypeFields()
WebformContentCreatorEntity::createNode in src/Entity/WebformContentCreatorEntity.php
Create node from webform submission.
WebformContentCreatorEntity::updateNode in src/Entity/WebformContentCreatorEntity.php
Update node from webform submission.
WebformContentCreatorManageFieldsForm::constructTable in src/Form/WebformContentCreatorManageFieldsForm.php
Constructs table with mapping between webform and content type.
WebformContentCreatorManageFieldsForm::validateForm in src/Form/WebformContentCreatorManageFieldsForm.php
Form validation handler.
WebformContentCreatorUtilities::getContentFieldsIds in src/WebformContentCreatorUtilities.php
Get content type fields, except the basic fields from node type entity.

File

src/WebformContentCreatorUtilities.php, line 199

Class

WebformContentCreatorUtilities
Provides useful functions required in Webform content creator module.

Namespace

Drupal\webform_content_creator

Code

public static function contentTypeFields(NodeType $content_type) {
  $entity_manager = \Drupal::service(self::ENTITY_MANAGER);
  $fields = [];
  if (!empty($content_type)) {
    $fields = $entity_manager
      ->getFieldDefinitions('node', $content_type
      ->getOriginalId());
  }
  return $fields;
}