public function BynderException::displayMessage in Bynder 4.0.x
Same name and namespace in other branches
- 8.3 src/Exception/BynderException.php \Drupal\bynder\Exception\BynderException::displayMessage()
- 8 src/Exception/BynderException.php \Drupal\bynder\Exception\BynderException::displayMessage()
- 8.2 src/Exception/BynderException.php \Drupal\bynder\Exception\BynderException::displayMessage()
Displays message to the user.
File
- src/
Exception/ BynderException.php, line 62
Class
- BynderException
- Base exception class for Bynder.
Namespace
Drupal\bynder\ExceptionCode
public function displayMessage() {
if (\Drupal::currentUser()
->hasPermission($this->adminPermission)) {
$this
->messenger()
->addError($this->adminMessage);
}
else {
$this
->messenger()
->addError($this
->getMessage());
}
}