You are here

public function WebformContentCreatorEntity::existsContentType in Webform Content Creator 3.x

Same name and namespace in other branches
  1. 8 src/Entity/WebformContentCreatorEntity.php \Drupal\webform_content_creator\Entity\WebformContentCreatorEntity::existsContentType()

Check if the content type entity exists.

Return value

bool True, if content type entity exists. Otherwise, returns false.

Overrides WebformContentCreatorInterface::existsContentType

File

src/Entity/WebformContentCreatorEntity.php, line 590

Class

WebformContentCreatorEntity
Defines the Webform Content creator entity.

Namespace

Drupal\webform_content_creator\Entity

Code

public function existsContentType() {

  // Get content type id.
  $content_type_id = $this
    ->getContentType();

  // Get content type entity.
  $content_type_entity = \Drupal::entityTypeManager()
    ->getStorage('node_type')
    ->load($content_type_id);
  return !empty($content_type_entity);
}