You are here

private function WebformContentCreatorEntity::getNodeTitle 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::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 259

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) !== '') {
    $title = $this
      ->get(WebformContentCreatorInterface::FIELD_TITLE);
  }
  else {
    $title = \Drupal::entityTypeManager()
      ->getStorage(WebformContentCreatorInterface::WEBFORM)
      ->load($this
      ->get(WebformContentCreatorInterface::WEBFORM))
      ->label();
  }
  return $title;
}