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