You are here

class BundleNotBynderException in Bynder 4.0.x

Same name and namespace in other branches
  1. 8.3 src/Exception/BundleNotBynderException.php \Drupal\bynder\Exception\BundleNotBynderException
  2. 8 src/Exception/BundleNotBynderException.php \Drupal\bynder\Exception\BundleNotBynderException
  3. 8.2 src/Exception/BundleNotBynderException.php \Drupal\bynder\Exception\BundleNotBynderException

Exception indicating that the bundle does not represent Bynder assets.

Hierarchy

Expanded class hierarchy of BundleNotBynderException

3 files declare their use of BundleNotBynderException
BynderSearch.php in src/Plugin/EntityBrowser/Widget/BynderSearch.php
BynderUpload.php in src/Plugin/EntityBrowser/Widget/BynderUpload.php
BynderWidgetBase.php in src/Plugin/EntityBrowser/Widget/BynderWidgetBase.php

File

src/Exception/BundleNotBynderException.php, line 10

Namespace

Drupal\bynder\Exception
View source
class BundleNotBynderException extends BynderException {

  /**
   * {@inheritdoc}
   */
  protected $adminPermission = 'administer entity browsers';

  /**
   * Constructs BundleNotBynderException.
   *
   * @param string $bundle
   *   Name of the bundle.
   */
  public function __construct($bundle) {
    $log_message = 'Media type @bundle is not using Bynder plugin. Please fix the Bynder <a href=":eb_conf">search widget configuration</a>.';
    $log_message_args = [
      ':eb_conf' => Url::fromRoute('entity.entity_browser.collection')
        ->toString(),
      '@bundle' => $bundle,
    ];
    $admin_message = $this
      ->t($log_message, $log_message_args);
    $message = $this
      ->t('Bynder integration is not configured correctly. Please contact the site administrator.');
    parent::__construct($message, $admin_message, $log_message, $log_message_args);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BundleNotBynderException::$adminPermission protected property Admin permission related to this exception. Overrides BynderException::$adminPermission
BundleNotBynderException::__construct public function Constructs BundleNotBynderException. Overrides BynderException::__construct
BynderException::$adminMessage protected property User-facing for admin users.
BynderException::$logMessage protected property Message to be logged in the Drupal's log.
BynderException::$logMessageArgs protected property Arguments for the log message.
BynderException::displayMessage public function Displays message to the user.
BynderException::logException public function Logs exception into Drupal's log.
MessengerTrait::$messenger protected property The messenger. 27
MessengerTrait::messenger public function Gets the messenger. 27
MessengerTrait::setMessenger public function Sets the messenger.
StringTranslationTrait::$stringTranslation protected property The string translation service. 4
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.