You are here

private function WebformContentCreatorEntity::getNodeTitle in Webform Content Creator 8

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

Get node title.

Return value

string Node title.

2 calls to WebformContentCreatorEntity::getNodeTitle()
WebformContentCreatorEntity::createNode in src/Entity/WebformContentCreatorEntity.php
Create node from webform submission.
WebformContentCreatorEntity::updateNode in src/Entity/WebformContentCreatorEntity.php
Update node from webform submission.

File

src/Entity/WebformContentCreatorEntity.php, line 260

Class

WebformContentCreatorEntity
Defines the Webform Content creator entity.

Namespace

Drupal\webform_content_creator\Entity

Code

private function getNodeTitle() {

  // Get title.
  if ($this
    ->get(WebformContentCreatorInterface::FIELD_TITLE) !== NULL && $this
    ->get(WebformContentCreatorInterface::FIELD_TITLE) !== '') {
    $nodeTitle = $this
      ->get(WebformContentCreatorInterface::FIELD_TITLE);
  }
  else {
    $nodeTitle = \Drupal::entityTypeManager()
      ->getStorage(WebformContentCreatorInterface::WEBFORM)
      ->load($this
      ->get(WebformContentCreatorInterface::WEBFORM))
      ->label();
  }
  return $nodeTitle;
}