You are here

public function WebformContentCreatorEntity::statusMessage 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::statusMessage()
  2. 2.x src/Entity/WebformContentCreatorEntity.php \Drupal\webform_content_creator\Entity\WebformContentCreatorEntity::statusMessage()

Show a message accordingly to status, after creating/updating an entity.

Parameters

int $status: Status int, returned after creating/updating an entity.

Overrides WebformContentCreatorInterface::statusMessage

File

src/Entity/WebformContentCreatorEntity.php, line 578

Class

WebformContentCreatorEntity
Defines the Webform Content creator entity.

Namespace

Drupal\webform_content_creator\Entity

Code

public function statusMessage($status) {
  if ($status) {
    $this
      ->messenger()
      ->addMessage($this
      ->t('Saved the %label entity.', [
      '%label' => $this
        ->getTitle(),
    ]));
  }
  else {
    $this
      ->messenger()
      ->addMessage($this
      ->t('The %label entity was not saved.', [
      '%label' => $this
        ->getTitle(),
    ]));
  }
}