public function WebformContentCreatorEntity::statusMessage in Webform Content Creator 2.x
Same name and namespace in other branches
- 8 src/Entity/WebformContentCreatorEntity.php \Drupal\webform_content_creator\Entity\WebformContentCreatorEntity::statusMessage()
- 3.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 635
Class
- WebformContentCreatorEntity
- Defines the Webform Content Creator entity.
Namespace
Drupal\webform_content_creator\EntityCode
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(),
]));
}
}